Changeset d9547e7 in sasview for sansmodels


Ignore:
Timestamp:
Feb 1, 2012 10:20:23 AM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
9ede123
Parents:
1ba8201d
Message:

Added linearpearlsmodel and a test

Location:
sansmodels
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/c_models/c_models.cpp

    rfd080830 rd9547e7  
    2020void addCSphereSLDModel(PyObject *module); 
    2121void addCOnionModel(PyObject *module); 
     22void addCLinearPearlsModel(PyObject *module); 
    2223void addCPearlNecklaceModel(PyObject *module); 
    2324void addCReflModel(PyObject *module); 
     
    277278  addCDiamCylFunc(m); 
    278279  addCSLDCalFunc(m); 
     280  addCLinearPearlsModel(m); 
    279281  addCPearlNecklaceModel(m); 
    280282  addCLamellarModel(m); 
  • sansmodels/test/utest_model_pearlnecklace.py

    r18e250c rd9547e7  
    1111        from sans.models.PearlNecklaceModel import PearlNecklaceModel 
    1212        self.pnl = PearlNecklaceModel() 
     13        from sans.models.LinearPearlsModel import LinearPearlsModel 
     14        self.lpm = LinearPearlsModel() 
    1315        from sans.models.SphereModel import SphereModel 
    1416        self.sphere = SphereModel() 
     
    4446        self.bar.setParam("rad_bar", 0.1) 
    4547        self.bar.setParam("rad_bell", 20) 
    46          
     48        self.lpm.setParam("radius", 20) 
     49        self.lpm.setParam("num_pearls", 2) 
     50        self.lpm.setParam("sld_pearl", 1e-06) 
     51        self.lpm.setParam("sld_solv", 6.3e-06) 
     52        self.lpm.setParam("edge_separation", 400) 
     53                 
    4754        self.assertAlmostEqual(self.pnl.run(0.001), self.bar.run(0.001), 1) 
    4855        self.assertAlmostEqual(self.pnl.run(0.005), self.bar.run(0.005), 1) 
     
    5259        self.assertAlmostEqual(self.pnl.run(0.5), self.bar.run(0.5), 1) 
    5360         
     61        self.assertAlmostEqual(self.pnl.run(0.001), self.lpm.run(0.001), 1) 
     62        self.assertAlmostEqual(self.pnl.run(0.005), self.lpm.run(0.005), 1) 
     63        self.assertAlmostEqual(self.pnl.run(0.01), self.lpm.run(0.01), 1) 
     64        self.assertAlmostEqual(self.pnl.run(0.05), self.lpm.run(0.05), 1) 
     65        self.assertAlmostEqual(self.pnl.run(0.1), self.lpm.run(0.1), 1) 
     66        self.assertAlmostEqual(self.pnl.run(0.5), self.lpm.run(0.5), 1) 
    5467         
    5568 
Note: See TracChangeset for help on using the changeset viewer.