Changeset 1780d59 in sasmodels for sasmodels/weights.py


Ignore:
Timestamp:
Aug 24, 2014 8:27:38 PM (10 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
1f21edf
Parents:
ce27e21
Message:

hack sasview model polydispersity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/weights.py

    rce27e21 r1780d59  
    3838        For orientation parameters use absolute. 
    3939        """ 
    40         npts, width, nsigmas = self.npts, self.width, self.nsigmas 
    4140        sigma = self.width * center if relative else self.width 
    4241        if sigma == 0: 
     
    122121)) 
    123122 
    124 def get_weights(disperser, n, width, nsigma, value, limits, relative): 
     123 
     124def get_weights(disperser, n, width, nsigmas, value, limits, relative): 
    125125    cls = models[disperser] 
    126     obj = cls(n, width, nsigma) 
     126    obj = cls(n, width, nsigmas) 
    127127    v,w = obj.get_weights(value, limits[0], limits[1], relative) 
    128128    return v,w 
     129 
     130# Hack to allow sasview dispersion objects to interoperate with sasmodels 
     131dispersers = dict((v.__name__,k) for k,v in models.items()) 
     132dispersers['DispersionModel'] = RectangleDispersion.type 
     133 
Note: See TracChangeset for help on using the changeset viewer.