Changes in src/sas/sascalc/data_util/qsmearing.py [392056d:f8aa738] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/data_util/qsmearing.py
r392056d rf8aa738 5 5 #This software was developed by the University of Tennessee as part of the 6 6 #Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 7 #project funded by the US National Science Foundation. 7 #project funded by the US National Science Foundation. 8 8 #See the license text in license.txt 9 9 #copyright 2008, University of Tennessee … … 13 13 import logging 14 14 import sys 15 from sasmodels import sesans16 15 17 from sasmodels.resolution import Slit1D, Pinhole1D , SESANS1D16 from sasmodels.resolution import Slit1D, Pinhole1D 18 17 from sasmodels.resolution2d import Pinhole2D 19 18 … … 49 48 50 49 # Look for resolution smearing data 51 _found_sesans = False52 if data.dx is not None and data.meta_data['loader']=='SESANS':53 if data.dx[0] > 0.0:54 _found_sesans = True55 56 if _found_sesans == True:57 return sesans_smear(data, model)58 59 50 _found_resolution = False 60 51 if data.dx is not None and len(data.dx) == len(data.x): … … 101 92 self.model = model 102 93 self.resolution = resolution 103 if hasattr(self.resolution, 'data'): 104 if self.resolution.data.meta_data['loader'] == 'SESANS': 105 self.offset = 0 106 # This is default behaviour, for future resolution/transform functions this needs to be revisited. 107 else: 108 self.offset = numpy.searchsorted(self.resolution.q_calc, self.resolution.q[0]) 109 else: 110 self.offset = numpy.searchsorted(self.resolution.q_calc, self.resolution.q[0]) 111 112 #self.offset = numpy.searchsorted(self.resolution.q_calc, self.resolution.q[0]) 94 self.offset = numpy.searchsorted(self.resolution.q_calc, self.resolution.q[0]) 113 95 114 96 def apply(self, iq_in, first_bin=0, last_bin=None): … … 144 126 q[first:last+1]. 145 127 """ 146 147 128 q = self.resolution.q 148 129 first = numpy.searchsorted(q, q_min) … … 161 142 width = data.dx if data.dx is not None else 0 162 143 return PySmear(Pinhole1D(q, width), model) 163 164 def sesans_smear(data, model=None):165 #This should be calculated characteristic length scale166 #Probably not a data prameter either167 #Need function to calculate this based on model168 #Here assume a number169 Rmax = 1000000170 q_calc = sesans.make_q(data.sample.zacceptance, Rmax)171 return PySmear(SESANS1D(data,q_calc),model)
Note: See TracChangeset
for help on using the changeset viewer.