reflectometry/refl1d — Issue #47: better support for Q R dR files
Author: pkienzle
Created: 2011-12-02 23:49:01+00:00
State: open

Many facilities produce Q, R, dR files with constant dQ/Q.

Include a function like read_QRdR with appropriate resolution options to make this easier.

For example

def read_QRdR(filename, dQoQ):
Q,R,dR = numpy.loadtxt(filename).T
probe = QProbe(Q, dQoQ*Q, data=(R,dR))
probe._sf_L = numpy.array([1.])
#probe._sf_idx = numpy.zeros(len(Q),'int32')
probe.calc_Qo = probe.Q
return probe
pp = read_QRdR('barb1A.ref', dQoQ=0.01)
mm = read_QRdR('barb1D.ref', dQoQ=0.01)
probe = PolarizedNeutronQProbe([mm,None,None,pp])