Changeset 1cdfd47 in sasmodels


Ignore:
Timestamp:
Apr 5, 2018 4:06:19 AM (7 years ago)
Author:
smk78
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
bc1dac6
Parents:
d712a0f (diff), 05df1de (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of https://github.com/SasView/sasmodels.git

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    r3221de0 r05df1de  
    593593            # Check whether we have a list of ndarrays [qx,qy] 
    594594            qx, qy = qdist 
    595             if not self._model_info.parameters.has_2d: 
    596                 return self.calculate_Iq(np.sqrt(qx ** 2 + qy ** 2)) 
    597             else: 
    598                 return self.calculate_Iq(qx, qy) 
     595            return self.calculate_Iq(qx, qy) 
    599596 
    600597        elif isinstance(qdist, np.ndarray): 
     
    677674        call_details, values, is_magnetic = make_kernel_args(calculator, pairs) 
    678675        #call_details.show() 
    679         #print("pairs", pairs) 
     676        #print("================ parameters ==================") 
     677        #for p, v in zip(parameters.call_parameters, pairs): print(p.name, v[0]) 
    680678        #for k, p in enumerate(self._model_info.parameters.call_parameters): 
    681679        #    print(k, p.name, *pairs[k]) 
     
    871869    CylinderModel().evalDistribution([0.1, 0.1]) 
    872870 
     871def magnetic_demo(): 
     872    Model = _make_standard_model('sphere') 
     873    model = Model() 
     874    model.setParam('M0:sld', 8) 
     875    q = np.linspace(-0.35, 0.35, 500) 
     876    qx, qy = np.meshgrid(q, q) 
     877    result = model.calculate_Iq(qx.flatten(), qy.flatten()) 
     878    result = result.reshape(qx.shape) 
     879 
     880    import pylab 
     881    pylab.imshow(np.log(result + 0.001)) 
     882    pylab.show() 
     883 
    873884if __name__ == "__main__": 
    874885    print("cylinder(0.1,0.1)=%g"%test_cylinder()) 
     886    #magnetic_demo() 
    875887    #test_product() 
    876888    #test_structure_factor() 
  • doc/guide/pd/polydispersity.rst

    r29afc50 rd712a0f  
    2020  P(q) = \text{scale} \langle F^* F \rangle / V + \text{background} 
    2121 
    22 where $F$ is the scattering amplitude and $\langle\cdot\rangle$ denotes an 
    23 average over the size distribution. 
     22where $F$ is the scattering amplitude and $\langle\cdot\rangle$ denotes an  
     23average over the size distribution $f(x; \bar x, \sigma)$, giving 
     24 
     25.. math:: 
     26 
     27  P(q) = \frac{\text{scale}}{V} \int_\mathbb{R}  
     28  f(x; \bar x, \sigma) F^2(q, x)\, dx + \text{background} 
    2429 
    2530Each distribution is characterized by a center value $\bar x$ or 
     
    4146with larger values of $N_\sigma$ required for heavier tailed distributions. 
    4247The scattering in general falls rapidly with $qr$ so the usual assumption 
    43 that $G(r - 3\sigma_r)$ is tiny and therefore $f(r - 3\sigma_r)G(r - 3\sigma_r)$ 
     48that $f(r - 3\sigma_r)$ is tiny and therefore $f(r - 3\sigma_r)f(r - 3\sigma_r)$ 
    4449will not contribute much to the average may not hold when particles are large. 
    4550This, too, will require increasing $N_\sigma$. 
     
    6368 
    6469Additional distributions are under consideration. 
     70 
     71.. note:: In 2009 IUPAC decided to introduce the new term 'dispersity' to replace  
     72           the term 'polydispersity' (see `Pure Appl. Chem., (2009), 81(2),  
     73           351-353 <http://media.iupac.org/publications/pac/2009/pdf/8102x0351.pdf>`_  
     74           in order to make the terminology describing distributions of properties  
     75           unambiguous. Throughout the SasView documentation we continue to use the  
     76           term polydispersity because one of the consequences of the IUPAC change is  
     77           that orientational polydispersity would not meet their new criteria (which  
     78           requires dispersity to be dimensionless). 
    6579 
    6680Suggested Applications 
Note: See TracChangeset for help on using the changeset viewer.