Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/data_util/qsmearing.py

    r392056d rf8aa738  
    55#This software was developed by the University of Tennessee as part of the 
    66#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.  
    88#See the license text in license.txt 
    99#copyright 2008, University of Tennessee 
     
    1313import logging 
    1414import sys 
    15 from sasmodels import sesans 
    1615 
    17 from sasmodels.resolution import Slit1D, Pinhole1D, SESANS1D 
     16from sasmodels.resolution import Slit1D, Pinhole1D 
    1817from sasmodels.resolution2d import Pinhole2D 
    1918 
     
    4948 
    5049    # 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  
    5950    _found_resolution = False 
    6051    if data.dx is not None and len(data.dx) == len(data.x): 
     
    10192        self.model = model 
    10293        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]) 
    11395 
    11496    def apply(self, iq_in, first_bin=0, last_bin=None): 
     
    144126        q[first:last+1]. 
    145127        """ 
    146  
    147128        q = self.resolution.q 
    148129        first = numpy.searchsorted(q, q_min) 
     
    161142    width = data.dx if data.dx is not None else 0 
    162143    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.