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

Bug in BRML file importer #117

Open
briantoby opened this issue Dec 12, 2024 · 3 comments
Open

Bug in BRML file importer #117

briantoby opened this issue Dec 12, 2024 · 3 comments
Assignees
Labels
Done? Probably complete, but not yet closed enhancement New feature or request Needed GSAS-II Inadequacies

Comments

@briantoby
Copy link
Collaborator

briantoby commented Dec 12, 2024

(from user) I'm trying to do a temperature calibration for my MTC-Furnace based on the Bruker manual. So I used the automation system to get an MgO measurement at each relevant temperature, and then I was going to use GSAS-II to do Rietveld on it to get the temperature. However, when I try and open any *.brml file with more then one data set in it, I get the following error:


Error message(s):

Bruker .brml file read error:
  Unhandled read exception: list index out of range
  Traceback info:
Traceback (most recent call last):
  File "C:\Users\BrukerAXS\gsas2full\GSAS-II\GSASII\GSASIIdataGUI.py", line 1007, in OnImportGeneric
    flag = rd.Reader(filename,self,buffer=rdbuffer,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\BrukerAXS\gsas2full\GSAS-II\GSASII\imports\G2pwd_BrukerRAW.py", line 287, in Reader
    x[i] = float(entry[2])
                 ~~~~~^^^
IndexError: list index out of range
@briantoby briantoby added the bug Something isn't working label Dec 12, 2024
briantoby added a commit that referenced this issue Dec 13, 2024
@briantoby briantoby self-assigned this Dec 13, 2024
@briantoby briantoby added enhancement New feature or request Needed GSAS-II Inadequacies and removed bug Something isn't working labels Dec 13, 2024
@briantoby
Copy link
Collaborator Author

Reader now handles single & multi-files.

@briantoby briantoby reopened this Dec 17, 2024
@briantoby
Copy link
Collaborator Author

more to do (from M.S.):

Quartz_100K_300K_286mm_1hr.brml => SiO2 alpha Quartz measured on heating from 100 K to 300 K, 6 ? scans in total. The temperature stage for the capillary is an Oxford N2 blower very much like that we had at 11-BM. (Newer model). These are “continuous type” scans; that is to say - the Eiger detector moves 2th during the scan in a classic fashion. The brml file opens, but the data are incorrect. Just some noise and / or flat lines.

I also include a JPG showing how its looks when opened in EVA, and I tried to export the first scan (100K) as Bruker v3 and V4 files. Neither opens in GSAS-II for me!

KNO3_VT_290K-410K_deltaT2_MoD8_ICMCB.brml => ~70 scans on heating up to the phase transition in KNO3. Data are not “continuous type”, but rather “Still” scans. That is to say, the large Eiger detector is parked and we just use the 2th opening of the detector for 1D scans of fixed time. Like a beam line 2D detector.

Bruker gets the units wrong, temperature units should be K, but are listed in EVA as deg C. I warned them about this; they ignored me. I think the brml data structure changes for different scan types. FWIW; the Bruker powder XRD software team is not amazing; either because they are understaffed or…. But the hardware and software team are not at the same level IMHO. The implementation is often confusiing , stability is not as it should be, and there are annoying bugs like this C / K issue.

This brml does not open at all in GSAS-II. Nor the Raw files.
(BHT: test data in ~/Scratch/BRML_bug, e-mail Date: Monday, December 16, 2024 at 9:18 AM,
Subject: Re: [GSAS-II] GSAS-II Digest, Vol 399, Issue 1: Bug in BRML file import).

@briantoby
Copy link
Collaborator Author

more work on BRML in c77fe68. There are still some open questions.

In the unscanned import, there seem to be too few points for the range of data. When I read the header for the KNO3 RawData files, I see a start, end, and increment angle:

Out[2]: 
{'ScaleAxisInfo': {'@xsi:type': 'ScaleAxisInfoRegular',
  '@DisplayTarget': 'X',
  '@AxisName': 'TwoTheta',
  '@VisibleName': '2Theta',
  '@UIVisibility': 'Primary',
  '@Unit': '',
  '@AxisId': 'TwoTheta',
  'Unit': {'@Prefix': 'None', '@Base': 'None'},
  'Reference': '0',
  'Start': '3.5946078994013337',
  'Stop': '18.390416585733924',
  'Increment': '0.014975514864709133'}}

So I expect 989 data points to cover that range:

In [7]: (18.390416585733924-3.5946078994013337)/0.014975514864709133
Out[7]: 987.9999999999977

but it seems I’m one data point short when I look at the stream of data points. Here are the first and last data points (in datum):

In [11]: np.array(xyT[:10])
Out[11]: 
array(['60', '1', '100.0183', '78.8567', '72.7353', '68.7929', '85.8281',
       '81.3343', '73.9892', '83.2119'], dtype='<U8')
 
In [12]: np.array(xyT[-10:])
Out[12]: 
array(['137.2933', '141.0482', '135.4148', '131.1688', '142.855',
       '135.2333', '139.5675', '147.4321', '291.2', '0'], dtype='<U8')

The first three numbers are not intensities (I am assuming the 1st is the data collection time and the 3rd is the temperature. Also, the last two also don’t seem right, but if I take the intensities as going from '78.8567' to '147.4321' then I have only 988 points, so the “scan” ends up being one point short of the full range. Did Bruker get this wrong?

Also, FWIW, the first point intensity read by GSAS-II in the Raw v3 file is the temperature. G2 bug or Bruker?

@briantoby briantoby added the Done? Probably complete, but not yet closed label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Done? Probably complete, but not yet closed enhancement New feature or request Needed GSAS-II Inadequacies
Projects
None yet
Development

No branches or pull requests

1 participant