diff --git a/xray/README.md b/xray/README.md new file mode 100644 index 0000000..f4868dc --- /dev/null +++ b/xray/README.md @@ -0,0 +1,6 @@ +# xray + +Different utilities to work with time resolved solution/powder scattering data +They should be extended to absorption soon + +The idea is the following diff --git a/xray/example_main_tiox.py b/xray/example_main_tiox.py new file mode 100644 index 0000000..364de02 --- /dev/null +++ b/xray/example_main_tiox.py @@ -0,0 +1,41 @@ +from __future__ import print_function,division +import numpy as np +import pylab as plt +import mcutils as mc +import mcutils.xray as xray +from mcutils.xray import id9 +id9 = xray.id9 + +# use npz files (they can handle more stuff (list of arrays,unicode) than h5py) +id9.storage_extension = '.npz' +#id9.storage_extension = '.h5' + +def azav(folder,nQ=1500,force=False,saveChi=True, + poni='auto',storageFile='auto',mask=470): + if isinstance(mask,int): + files = xray.utils.getFiles(folder,"*.edf*") + img = xray.azav.pyFAIread(files[0]) + temp = np.ones_like(img,dtype=bool) + temp[:mask] = False + mask = temp + return id9.doFolder_azav(folder,nQ=nQ,force=force,mask=mask,saveChi=saveChi, + poni=poni,storageFile=storageFile) + +def datared(folder,monitor=(1,5),showPlot=True,**kw): + data,diffs = id9.doFolder_dataRed(folder,monitor=monitor,**kw) + if showPlot: xray.utils.plotdiffs(diffs.q,diffs.data,t=diffs.scan) + return data,diffs + +def doall(folder,force=False): + azav(folder,force=force) + return datared(folder) + + +def plotCalc(scale=1): + fold = "../tiox/calculated_patterns/" + q,i=readtxt(fold + "alpha500K.xye.q") + plt.plot(q,i*scale,label="alpha") + q,i=readtxt(fold + "beta290K.xye.q") + plt.plot(q,i*scale,label="beta") + q,i=readtxt(fold + "lambda.xye.q") + plt.plot(q,i*scale,label="lambda")