Changeset 55db501 in sasview for src/sas/sascalc


Ignore:
Timestamp:
Nov 20, 2016 3:36:43 AM (8 years ago)
Author:
jhbakker
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:
e4078ed
Parents:
a01af35
Message:

test branch for SESANS class in sesans.py

File:
1 edited

Legend:

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

    ra01af35 r55db501  
    1515import time 
    1616from sasmodels import sesans 
    17  
    1817import numpy as np  # type: ignore 
    1918from numpy import pi, exp  # type: ignore 
     
    6160    # TODO: change other sanity checks to check for file loader instead of data structure? 
    6261    _found_sesans = False 
    63     if data.dx is not None and data.meta_data['loader']=='SESANS': 
     62    #if data.dx is not None and data.meta_data['loader']=='SESANS': 
     63    if data.dx is not None and data.isSesans: 
    6464        if data.dx[0] > 0.0: 
    6565            _found_sesans = True 
     
    6767    if _found_sesans == True: 
    6868        #Pre-compute the Hankel matrix (H) 
    69         H0,H, q_calc = sesans.Hankelconstructor(data) 
     69        qmax, qunits = data.sample.zacceptance 
     70        Hankelinst=sesans.SesansTransform() 
     71        sesans.SesansTransform.set_transform(Hankelinst, 
     72        SE = Converter(data._xunit)(data.x, "A"), 
     73        zaccept = Converter(qunits)(qmax, "1/A"), 
     74        Rmax = 1000000) 
     75        H=sesans.SesansTransform._H 
     76        H0=sesans.SesansTransform._H0 
     77        q=sesans.SesansTransform.q 
    7078        # Then return the actual transform, as if it were a smearing function 
    71         return PySmear(SESANS1D(data, H0, H, q_calc), model) 
     79        # applying evalDistribution to a model, with a q-space as param, returns the I(q) values that go with the q-values 
     80 
     81        return PySmear(SESANS1D(data, H0, H, q), model) 
    7282 
    7383    _found_resolution = False 
     
    175185    width = data.dx if data.dx is not None else 0 
    176186    return PySmear(Pinhole1D(q, width), model) 
    177  
    178 def sesans_smear(data, model=None): 
    179     #This should be calculated characteristic length scale 
    180     #Probably not a data prameter either 
    181     #Need function to calculate this based on model 
    182     #Here assume a number 
    183     Rmax = 1000000 
    184     q_calc = sesans.make_q(data.sample.zacceptance, Rmax) 
    185     SElength=Converter(data._xunit)(data.x, "A") 
    186     #return sesans.HankelTransform(q_calc, SElength) 
    187     #Old return statement, running through the smearer 
    188     #return PySmear(SESANS1D(data,q_calc),model) 
Note: See TracChangeset for help on using the changeset viewer.