smearing_2d

DataLoader.smearing_2d

class DataLoader.smearing_2d.Smearer2D(data=None, model=None, index=None, limit=2.5, accuracy='Low')

Gaussian Q smearing class for SANS 2d data

get_data()
get qx_data, qy_data, dqx_data,dqy_data,and calculate phi_data=arctan(qx_data/qy_data)
get_value()

Over sampling of r_nbins times phi_nbins, calculate Gaussian weights, then find smeared intensity For the default values, this is equivalent (but by using numpy array the speed optimized by a factor of ten)to the following:

Remove the singular points if exists
self.dqx_data[self.dqx_data==0]=SIGMA_ZERO
self.dqy_data[self.dqy_data==0]=SIGMA_ZERO

for phi in range(0,4):
    for r in range(0,5):
        n = (phi)*5+(r)
        r = r+0.25
        dphi = phi*2.0*math.pi/4.0 + numpy.arctan(self.qy_data[index_model]/self.dqy_data[index_model]/self.qx_data[index_model]*/self.dqx_data[index_model])
        dq = r*sqrt( self.dqx_data[index_model]*self.dqx_data[index_model]                         + self.dqy_data[index_model]*self.dqy_data[index_model] )
        #integrant of exp(-0.5*r*r) r dr at each bins : The integration may not need.
        weight_res[n] = e^{(-0.5*((r-0.25)*(r-0.25)))}- e^{(-0.5*((r-0.25)*(r-0.25)))}
        #if phi != 0 and r != 0:
        qx_res = numpy.append(qx_res,self.qx_data[index_model]+ dq * cos(dphi))
        qy_res = numpy.append(qy_res,self.qy_data[index_model]+ dq * sin(dphi))

Then compute I(qx_res,qy_res) and do weighted averaging.

set_accuracy(accuracy='Low')

Set accuracy.

Parameters:
  • accuracy – string
set_data(data=None)

Set data.

Parameters:
  • data – DataLoader.Data_info type
set_index(index=None)

Set index.

Parameters:
  • index – 1d arrays
set_model(model=None)

Set model.

Parameters:
  • model – sans.models instance
set_smearer(smearer=True)

Set whether or not smearer will be used

Parameters:
  • smearer – smear object

Table Of Contents

Previous topic

qsmearing

Next topic

Readers

This Page