Changeset 157b716 in sasview for src/sas/sascalc
- Timestamp:
- Feb 6, 2017 5:02:46 PM (8 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 68adf86
- Parents:
- ad4632c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/data_util/qsmearing.py
r2a2b43a r157b716 13 13 import logging 14 14 import sys 15 from sasmodels import sesans16 15 import numpy as np # type: ignore 17 16 from numpy import pi, exp # type:ignore 18 17 from sasmodels.resolution import Slit1D, Pinhole1D 19 from sasmodels.sesans import S ESANS1D18 from sasmodels.sesans import SesansTransform 20 19 from sasmodels.resolution2d import Pinhole2D 21 20 from src.sas.sascalc.data_util.nxsunit import Converter … … 68 67 #Pre-compute the Hankel matrix (H) 69 68 qmax, qunits = data.sample.zacceptance 70 hankel = sesans.SesansTransform(SE=Converter(data._xunit)(data.x, "A"), 71 zaccept=Converter(qunits)(qmax, "1/A"), 72 Rmax=10000000) 69 SElength = Converter(data._xunit)(data.x, "A") 70 zaccept = Converter(qunits)(qmax, "1/A"), 71 Rmax = 10000000 72 hankel = SesansTransform(data.x, SElength, zaccept, Rmax) 73 73 # Then return the actual transform, as if it were a smearing function 74 return PySmear( SESANS1D(data, hankel.H0, hankel.H, hankel.q), model)74 return PySmear(hankel, model, offset=0) 75 75 76 76 _found_resolution = False … … 115 115 Wrapper for pure python sasmodels resolution functions. 116 116 """ 117 def __init__(self, resolution, model ):117 def __init__(self, resolution, model, offset=None): 118 118 self.model = model 119 119 self.resolution = resolution 120 121 if hasattr(self.resolution, 'data'): 122 #if self.resolution.data.meta_data['loader'] == 'SESANS': # Always True if file extension is '.ses'! 123 if self.resolution.data.isSesans: 124 self.offset = 0 125 # This is default behaviour, for future resolution/transform functions this needs to be revisited. 126 else: 127 self.offset = numpy.searchsorted(self.resolution.q_calc, self.resolution.q[0]) 128 else: 129 self.offset = numpy.searchsorted(self.resolution.q_calc, self.resolution.q[0]) 130 131 # self.offset = numpy.searchsorted(self.resolution.q_calc, self.resolution.q[0]) 120 if offset is None: 121 offset = numpy.searchsorted(self.resolution.q_calc, self.resolution.q[0]) 122 self.offset = offset 132 123 133 124 def apply(self, iq_in, first_bin=0, last_bin=None):
Note: See TracChangeset
for help on using the changeset viewer.