scikit-beam / scikit-beam

Data analysis tools for X-Ray, Neutron and Electron sciences
BSD 3-Clause "New" or "Revised" License
93 stars 61 forks source link

2D to 1D reduced files for diffraction ( *.chi) files are not usable with some other software #465

Open sghose opened 7 years ago

sghose commented 7 years ago

The chi files ( 1 d files) generated by scikit-beam from 2D diffraction images are having a few more header lines which might be creating problem in using them with other software ( eg, xPDFSuite) for further analysis. Here I am attaching two such files one created by scikit-beam and one created by FIT2D.

scikit-beam_Q.txt Fit2D_Q.txt

tacaswell commented 7 years ago

Can you provide a minimal code snippet of how you produced this file?

sghose commented 7 years ago

I am using Chris's mask writer/xpd_workflow that he provided me. That is being incorporated into scikit-beam to get the chi files. How do I share these discussion with Chris? He could answer better to any of your questions.

tacaswell commented 7 years ago

attn @CJ-Wright

CJ-Wright commented 7 years ago

I mean you could just pass two random arrays to the save_powder_output function. The issue is that some code seems to have hard coded the number of lines in a chi file and the skbeam code doesn't play well with that.

tacaswell commented 7 years ago

@CJ-Wright I do not really understand your comment.

CJ-Wright commented 7 years ago

@tacaswell sorry, let me try to be clearer.

The problem seems to be not the data itself, but the size of the header used to produce the .chi files via save_powder_output. It seems that other pieces of software trying to read the .chi files are having difficulty with the header size. I imagine to recreate the error we could just do:

import numpy as np
from skbeam.io.save_powder_output import save_output
save_output(np.arange(0, 25.1, .1), np.arange(0, 25.1, .1), 'test', 'Q')

And then try to run the resulting file through some of these programs, like xPDFSuite, trying to read the file.

tacaswell commented 7 years ago

Is there a document for what should be a '*chi' file ?

Shouldn't we really be filing a bug report against xPDFSuite :imp: .

CJ-Wright commented 7 years ago

I am not certain if there is a global standard for *.chi files. I can try to look when I get a chance.

@sghose Did you find this problem with any other software packages?