Changes in src/sas/sascalc/data_util/qsmearing.py [f8aa738:392056d] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/data_util/qsmearing.py
rf8aa738 r392056d 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 sesans 15 16 16 from sasmodels.resolution import Slit1D, Pinhole1D 17 from sasmodels.resolution import Slit1D, Pinhole1D, SESANS1D 17 18 from sasmodels.resolution2d import Pinhole2D 18 19 … … 48 49 49 50 # Look for resolution smearing data 51 _found_sesans = False 52 if data.dx is not None and data.meta_data['loader']=='SESANS': 53 if data.dx[0] > 0.0: 54 _found_sesans = True 55 56 if _found_sesans == True: 57 return sesans_smear(data, model) 58 50 59 _found_resolution = False 51 60 if data.dx is not None and len(data.dx) == len(data.x): … … 92 101 self.model = model 93 102 self.resolution = resolution 94 self.offset = numpy.searchsorted(self.resolution.q_calc, self.resolution.q[0]) 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]) 95 113 96 114 def apply(self, iq_in, first_bin=0, last_bin=None): … … 126 144 q[first:last+1]. 127 145 """ 146 128 147 q = self.resolution.q 129 148 first = numpy.searchsorted(q, q_min) … … 142 161 width = data.dx if data.dx is not None else 0 143 162 return PySmear(Pinhole1D(q, width), model) 163 164 def sesans_smear(data, model=None): 165 #This should be calculated characteristic length scale 166 #Probably not a data prameter either 167 #Need function to calculate this based on model 168 #Here assume a number 169 Rmax = 1000000 170 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.