Gaussian Q smearing class for SANS 2d data
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.
Parameters: |
|
---|
Set data.
Parameters: |
|
---|
Set index.
Parameters: |
|
---|
Set model.
Parameters: |
|
---|
Set whether or not smearer will be used
Parameters: |
|
---|