Index: build.txt
===================================================================
--- build.txt	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ build.txt	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,96 @@
+﻿=== Done ===
+Total number of model  wrappers created is 67
+running build
+running build_py
+package init file 'src\sas\dataloader\readers\schema\__init__.py' not found (or not a regular file)
+copying src\sas\perspectives\fitting\fitpage.py -> build\lib.win32-2.7\sas\perspectives\fitting
+copying src\sas\models\BarBellModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\BCCrystalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\BinaryHSModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CappedCylinderModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\Core2ndMomentModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CoreFourShellModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CoreShellBicelleModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CoreShellCylinderModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CoreShellEllipsoidModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CoreShellEllipsoidXTModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CoreShellModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CSParallelepipedModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CylinderModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\DABModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\DiamCylFunc.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\DiamEllipFunc.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\EllipsoidModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\EllipticalCylinderModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\FCCrystalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\FlexCylEllipXModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\FlexibleCylinderModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\FractalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\FractalO_Z.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\FuzzySphereModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\Gaussian.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\GelFitModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\HardsphereStructure.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\HayterMSAStructure.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\HollowCylinderModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LamellarFFHGModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LamellarModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LamellarPCrystalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LamellarPSHGModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LamellarPSModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LinearPearlsModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LogNormal.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\Lorentzian.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\MassFractalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\MassSurfaceFractal.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\MicelleSphCoreModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\MultiShellModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\OnionModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\ParallelepipedModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\PearlNecklaceModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\Poly_GaussCoil.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\PringlesModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\RaspBerryModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\RectangularHollowPrismInfThinWallsModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\RectangularHollowPrismModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\RectangularPrismModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\ReflAdvModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\ReflModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\RPAModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\SCCrystalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\Schulz.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\SLDCalFunc.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\SphereModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\SphereSLDModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\SquareWellStructure.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\StackedDisksModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\StarPolymer.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\StickyHSStructure.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\SurfaceFractalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\TeubnerStreyModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\TriaxialEllipsoidModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\TwoYukawaModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\VesicleModel.py -> build\lib.win32-2.7\sas\models
+running build_ext
+Compiling with mingw32 (64bit=False)
+building 'sas.models.sas_extension.c_models' extension
+C compiler: gcc -O2 -Wall -Wstrict-prototypes
+
+compile options: '-D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c'
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CBinaryHSModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cbinaryhsmodel.o
+Found executable C:\TDM-GCC-32\bin\gcc.exe
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CFlexibleCylinderModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cflexiblecylindermodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\triaxialellipsoid.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\triaxialellipsoid.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\schulz.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\schulz.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\massfractal.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\massfractal.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CSCCrystalModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\csccrystalmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCoreFourShellModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccorefourshellmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\logNormal.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lognormal.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CFractalModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cfractalmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CRaspBerryModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\craspberrymodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\HayterMSA.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\haytermsa.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\coreshellbicelle.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\coreshellbicelle.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\fuzzysphere.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\fuzzysphere.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\hollowcylinder.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\hollowcylinder.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCoreShellModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccoreshellmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCoreShellBicelleModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccoreshellbicellemodel.o
Index: install.txt
===================================================================
--- install.txt	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ install.txt	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,2805 @@
+﻿Total number of model  wrappers created is 67
+running install
+running bdist_egg
+running egg_info
+writing requirements to sasview.egg-info\requires.txt
+writing sasview.egg-info\PKG-INFO
+writing top-level names to sasview.egg-info\top_level.txt
+writing dependency_links to sasview.egg-info\dependency_links.txt
+writing entry points to sasview.egg-info\entry_points.txt
+package init file 'src\sas\dataloader\readers\schema\__init__.py' not found (or not a regular file)
+reading manifest file 'sasview.egg-info\SOURCES.txt'
+writing manifest file 'sasview.egg-info\SOURCES.txt'
+installing library code to build\bdist.win32\egg
+running install_lib
+running build_py
+copying src\sas\models\BarBellModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\BCCrystalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\BinaryHSModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CappedCylinderModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\Core2ndMomentModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CoreFourShellModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CoreShellBicelleModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CoreShellCylinderModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CoreShellEllipsoidModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CoreShellEllipsoidXTModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CoreShellModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CSParallelepipedModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\CylinderModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\DABModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\DiamCylFunc.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\DiamEllipFunc.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\EllipsoidModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\EllipticalCylinderModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\FCCrystalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\FlexCylEllipXModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\FlexibleCylinderModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\FractalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\FractalO_Z.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\FuzzySphereModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\Gaussian.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\GelFitModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\HardsphereStructure.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\HayterMSAStructure.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\HollowCylinderModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LamellarFFHGModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LamellarModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LamellarPCrystalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LamellarPSHGModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LamellarPSModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LinearPearlsModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\LogNormal.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\Lorentzian.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\MassFractalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\MassSurfaceFractal.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\MicelleSphCoreModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\MultiShellModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\OnionModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\ParallelepipedModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\PearlNecklaceModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\Poly_GaussCoil.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\PringlesModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\RaspBerryModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\RectangularHollowPrismInfThinWallsModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\RectangularHollowPrismModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\RectangularPrismModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\ReflAdvModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\ReflModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\RPAModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\SCCrystalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\Schulz.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\SLDCalFunc.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\SphereModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\SphereSLDModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\SquareWellStructure.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\StackedDisksModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\StarPolymer.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\StickyHSStructure.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\SurfaceFractalModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\TeubnerStreyModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\TriaxialEllipsoidModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\TwoYukawaModel.py -> build\lib.win32-2.7\sas\models
+copying src\sas\models\VesicleModel.py -> build\lib.win32-2.7\sas\models
+running build_ext
+Compiling with mingw32 (64bit=False)
+building 'sas.models.sas_extension.c_models' extension
+C compiler: gcc -O2 -Wall -Wstrict-prototypes
+
+compile options: '-D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c'
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CBinaryHSModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cbinaryhsmodel.o
+Found executable C:\TDM-GCC-32\bin\gcc.exe
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CFlexibleCylinderModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cflexiblecylindermodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\triaxialellipsoid.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\triaxialellipsoid.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\schulz.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\schulz.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\massfractal.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\massfractal.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CSCCrystalModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\csccrystalmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCoreFourShellModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccorefourshellmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\logNormal.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lognormal.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CFractalModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cfractalmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CRaspBerryModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\craspberrymodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\HayterMSA.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\haytermsa.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\coreshellbicelle.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\coreshellbicelle.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\fuzzysphere.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\fuzzysphere.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\hollowcylinder.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\hollowcylinder.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCoreShellModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccoreshellmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCoreShellBicelleModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccoreshellbicellemodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CGaussian.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cgaussian.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\fcc.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\fcc.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CGelFitModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cgelfitmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CFCCrystalModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cfccrystalmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CPearlNecklaceModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cpearlnecklacemodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CSphereSLDModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cspheresldmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\binaryHS_PSF11.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\binaryhs_psf11.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\flexiblecylinder.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\flexiblecylinder.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\libfunc.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\libfunc.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\rpa.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\rpa.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\sld_cal.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\sld_cal.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\dispersion_visitor.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\dispersion_visitor.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CPoly_GaussCoil.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cpoly_gausscoil.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CRectangularHollowPrismInfThinWallsModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\crectangularhollowprisminfthinwallsmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\barbell.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\barbell.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\libigor\libStructureFactor.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\libstructurefactor.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\lorentzian.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lorentzian.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCSParallelepipedModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccsparallelepipedmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CLamellarPSModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clamellarpsmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\dabmodel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\dabmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\masssurfacefractal.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\masssurfacefractal.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CMassFractalModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cmassfractalmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CMicelleSphCoreModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cmicellesphcoremodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\multishell.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\multishell.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CReflModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\creflmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\csparallelepiped.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\csparallelepiped.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CBarBellModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cbarbellmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\cylinder.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\cylinder.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\DiamEllip.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\diamellip.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\libigor\GaussWeights.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\gaussweights.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\polygausscoil.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\polygausscoil.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\binaryHS.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\binaryhs.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\StickyHS.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\stickyhs.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CMassSurfaceFractal.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cmasssurfacefractal.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CDABModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cdabmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\lamellarPC.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lamellarpc.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CRectangularHollowPrismModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\crectangularhollowprismmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CBCCrystalModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cbccrystalmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\lamellarFF_HG.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lamellarff_hg.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CTeubnerStreyModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cteubnerstreymodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\ellipticalcylinder.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\ellipticalcylinder.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\libigor\2Y_cpoly.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\2y_cpoly.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\capcyl.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\capcyl.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\GelFit.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\gelfit.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\sc.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\sc.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\raspberry.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\raspberry.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CRectangularPrismModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\crectangularprismmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\refl_adv.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\refl_adv.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\Hardsphere.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\hardsphere.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\libigor\2Y_PairCorrelation.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\2y_paircorrelation.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CSLDCalFunc.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\csldcalfunc.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCoreShellEllipsoidModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccoreshellellipsoidmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CLorentzian.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clorentzian.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CHardsphereStructure.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\chardspherestructure.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\stackeddisks.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\stackeddisks.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CReflAdvModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\crefladvmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\lamellarPS_HG.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lamellarps_hg.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\libigor\2Y_utility.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\2y_utility.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CFractalO_Z.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cfractalo_z.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\libigor\winFuncs.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\winfuncs.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CLamellarPSHGModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clamellarpshgmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\sphere.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\sphere.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\parameters.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\parameters.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\libigor\libCylinder.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\libcylinder.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\RectangularHollowPrism.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\rectangularhollowprism.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\pringles.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\pringles.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\libigor\libSphere.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\libsphere.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CSchulz.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cschulz.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CSquareWellStructure.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\csquarewellstructure.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CLinearPearlsModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clinearpearlsmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CEllipticalCylinderModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cellipticalcylindermodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CHayterMSAStructure.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\chaytermsastructure.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\lamellar.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lamellar.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\SquareWell.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\squarewell.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\spheroidXT.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\spheroidxt.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CDiamCylFunc.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cdiamcylfunc.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CStackedDisksModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cstackeddisksmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\refl.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\refl.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CLogNormal.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clognormal.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CMultiShellModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cmultishellmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CLamellarPCrystalModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clamellarpcrystalmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CSphereModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cspheremodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\starpolymer.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\starpolymer.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\gaussian.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\gaussian.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\micelleSphCore.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\micellesphcore.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CFlexCylEllipXModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cflexcylellipxmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CDiamEllipFunc.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cdiamellipfunc.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CStickyHSStructure.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cstickyhsstructure.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\teubner_strey.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\teubner_strey.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\libigor\2Y_TwoYukawa.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\2y_twoyukawa.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CParallelepipedModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cparallelepipedmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\fractal.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\fractal.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CFuzzySphereModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cfuzzyspheremodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCylinderModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccylindermodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\bcc.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\bcc.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CTwoYukawaModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ctwoyukawamodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\onion.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\onion.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\surfacefractal.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\surfacefractal.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\linearpearls.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\linearpearls.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCoreShellCylinderModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccoreshellcylindermodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\ellipsoid.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\ellipsoid.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CLamellarModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clamellarmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CSurfaceFractalModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\csurfacefractalmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\spheroid.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\spheroid.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CTriaxialEllipsoidModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ctriaxialellipsoidmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\RectangularHollowPrismInfThinWalls.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\rectangularhollowprisminfthinwalls.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\libigor\libTwoPhase.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\libtwophase.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CEllipsoidModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cellipsoidmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CStarPolymer.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cstarpolymer.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\coreshellsphere.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\coreshellsphere.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\vesicle.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\vesicle.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CRPAModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\crpamodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CVesicleModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cvesiclemodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\spheresld.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\spheresld.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CHollowCylinderModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\chollowcylindermodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\RectangularPrism.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\rectangularprism.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\FractalQtoN.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\fractalqton.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\TwoYukawa.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\twoyukawa.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CLamellarFFHGModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clamellarffhgmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCappedCylinderModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccappedcylindermodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\gamma_win.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\gamma_win.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\coreshellcylinder.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\coreshellcylinder.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCoreShellEllipsoidXTModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccoreshellellipsoidxtmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CPringlesModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cpringlesmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\corefourshell.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\corefourshell.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\flexcyl_ellipX.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\flexcyl_ellipx.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\CCore2ndMomentModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccore2ndmomentmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\libigor\2Y_OneYukawa.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\2y_oneyukawa.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\c_models.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\c_models.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\coresecondmoment.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\coresecondmoment.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\python_wrapper\generated\COnionModel.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\conionmodel.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\DiamCyl.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\diamcyl.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\disperser.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\disperser.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\lamellarPS.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lamellarps.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\parallelepiped.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\parallelepiped.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\librefl.c -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\librefl.o
+gcc -O2 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x0900 -Isrc\sas\models\c_extension\libigor -Isrc\sas\models\include -Isrc\sas\models\c_extension\c_models -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\core\include\numpy -Isrc\sas\models\c_extension\cephes -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\include -IC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PC -c src\sas\models\c_extension\c_models\pearlnecklace.cpp -o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\pearlnecklace.o
+g++ -shared build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\2y_cpoly.o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\2y_oneyukawa.o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\2y_paircorrelation.o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\2y_twoyukawa.o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\2y_utility.o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\gaussweights.o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\libcylinder.o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\libsphere.o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\libstructurefactor.o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\libtwophase.o build\temp.win32-2.7\Release\src\sas\models\c_extension\libigor\winfuncs.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\barbell.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\bcc.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\binaryhs.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\binaryhs_psf11.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\capcyl.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\corefourshell.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\coresecondmoment.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\coreshellbicelle.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\coreshellcylinder.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\coreshellsphere.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\csparallelepiped.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\cylinder.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\c_models.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\dabmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\diamcyl.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\diamellip.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\disperser.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\dispersion_visitor.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\ellipsoid.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\ellipticalcylinder.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\fcc.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\flexcyl_ellipx.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\flexiblecylinder.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\fractal.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\fractalqton.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\fuzzysphere.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\gamma_win.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\gaussian.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\gelfit.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\hardsphere.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\haytermsa.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\hollowcylinder.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lamellar.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lamellarff_hg.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lamellarpc.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lamellarps.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lamellarps_hg.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\libfunc.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\librefl.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\linearpearls.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lognormal.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\lorentzian.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\massfractal.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\masssurfacefractal.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\micellesphcore.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\multishell.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\onion.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\parallelepiped.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\parameters.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\pearlnecklace.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\polygausscoil.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\pringles.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\raspberry.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\rectangularhollowprism.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\rectangularhollowprisminfthinwalls.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\rectangularprism.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\refl.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\refl_adv.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\rpa.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\sc.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\schulz.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\sld_cal.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\sphere.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\spheresld.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\spheroid.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\spheroidxt.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\squarewell.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\stackeddisks.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\starpolymer.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\stickyhs.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\surfacefractal.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\teubner_strey.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\triaxialellipsoid.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\twoyukawa.o build\temp.win32-2.7\Release\src\sas\models\c_extension\c_models\vesicle.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cbarbellmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cbccrystalmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cbinaryhsmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccappedcylindermodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccore2ndmomentmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccorefourshellmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccoreshellbicellemodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccoreshellcylindermodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccoreshellellipsoidmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccoreshellellipsoidxtmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccoreshellmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccsparallelepipedmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ccylindermodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cdabmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cdiamcylfunc.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cdiamellipfunc.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cellipsoidmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cellipticalcylindermodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cfccrystalmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cflexcylellipxmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cflexiblecylindermodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cfractalmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cfractalo_z.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cfuzzyspheremodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cgaussian.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cgelfitmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\chardspherestructure.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\chaytermsastructure.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\chollowcylindermodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clamellarffhgmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clamellarmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clamellarpcrystalmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clamellarpshgmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clamellarpsmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clinearpearlsmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clognormal.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\clorentzian.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cmassfractalmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cmasssurfacefractal.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cmicellesphcoremodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cmultishellmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\conionmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cparallelepipedmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cpearlnecklacemodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cpoly_gausscoil.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cpringlesmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\craspberrymodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\crectangularhollowprisminfthinwallsmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\crectangularhollowprismmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\crectangularprismmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\crefladvmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\creflmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\crpamodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\csccrystalmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cschulz.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\csldcalfunc.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cspheremodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cspheresldmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\csquarewellstructure.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cstackeddisksmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cstarpolymer.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cstickyhsstructure.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\csurfacefractalmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cteubnerstreymodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ctriaxialellipsoidmodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\ctwoyukawamodel.o build\temp.win32-2.7\Release\src\sas\models\c_extension\python_wrapper\generated\cvesiclemodel.o -LC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\libs -LC:\Users\gonzalezm\AppData\Local\Continuum\Anaconda\PCbuild -lpython27 -lmsvcr90 -o build\lib.win32-2.7\sas\models\sas_extension\c_models.pyd
+Found executable C:\TDM-GCC-32\bin\g++.exe
+creating build\bdist.win32\egg
+creating build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\assembly.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\data.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\deps.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\diffev.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\expression.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\fit.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\fitmc.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\fitresult.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\fitservice.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\formatnum.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\message.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\model.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\monitor.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\parameter.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\parkde.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\parksnob.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\peaks.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\pmap.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\rangemap.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\serial.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\setup.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\simplex.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\version.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\wxmonitor.py -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\_modeling.pyd -> build\bdist.win32\egg\park
+copying build\lib.win32-2.7\park\__init__.py -> build\bdist.win32\egg\park
+creating build\bdist.win32\egg\sans
+creating build\bdist.win32\egg\sans\calculator
+copying build\lib.win32-2.7\sans\calculator\instrument.py -> build\bdist.win32\egg\sans\calculator
+copying build\lib.win32-2.7\sans\calculator\kiessig_calculator.py -> build\bdist.win32\egg\sans\calculator
+copying build\lib.win32-2.7\sans\calculator\resolution_calculator.py -> build\bdist.win32\egg\sans\calculator
+copying build\lib.win32-2.7\sans\calculator\sans_gen.py -> build\bdist.win32\egg\sans\calculator
+copying build\lib.win32-2.7\sans\calculator\slit_length_calculator.py -> build\bdist.win32\egg\sans\calculator
+copying build\lib.win32-2.7\sans\calculator\__init__.py -> build\bdist.win32\egg\sans\calculator
+creating build\bdist.win32\egg\sans\dataloader
+copying build\lib.win32-2.7\sans\dataloader\data_info.py -> build\bdist.win32\egg\sans\dataloader
+copying build\lib.win32-2.7\sans\dataloader\loader.py -> build\bdist.win32\egg\sans\dataloader
+copying build\lib.win32-2.7\sans\dataloader\manipulations.py -> build\bdist.win32\egg\sans\dataloader
+creating build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\abs_reader.py -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\ascii_reader.py -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\associations.py -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\cansas_constants.py -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\cansas_reader.py -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\danse_reader.py -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\defaults.xml -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\hfir1d_reader.py -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\IgorReader.py -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\nexus_reader.py -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\red2d_reader.py -> build\bdist.win32\egg\sans\dataloader\readers
+creating build\bdist.win32\egg\sans\dataloader\readers\schema
+copying build\lib.win32-2.7\sans\dataloader\readers\schema\cansas1d_v1_0.xsd -> build\bdist.win32\egg\sans\dataloader\readers\schema
+copying build\lib.win32-2.7\sans\dataloader\readers\schema\cansas1d_v1_1.xsd -> build\bdist.win32\egg\sans\dataloader\readers\schema
+copying build\lib.win32-2.7\sans\dataloader\readers\tiff_reader.py -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\xml_reader.py -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\readers\__init__.py -> build\bdist.win32\egg\sans\dataloader\readers
+copying build\lib.win32-2.7\sans\dataloader\__init__.py -> build\bdist.win32\egg\sans\dataloader
+creating build\bdist.win32\egg\sans\data_util
+copying build\lib.win32-2.7\sans\data_util\calcthread.py -> build\bdist.win32\egg\sans\data_util
+copying build\lib.win32-2.7\sans\data_util\err1d.py -> build\bdist.win32\egg\sans\data_util
+copying build\lib.win32-2.7\sans\data_util\formatnum.py -> build\bdist.win32\egg\sans\data_util
+copying build\lib.win32-2.7\sans\data_util\nxsunit.py -> build\bdist.win32\egg\sans\data_util
+copying build\lib.win32-2.7\sans\data_util\odict.py -> build\bdist.win32\egg\sans\data_util
+copying build\lib.win32-2.7\sans\data_util\ordereddict.py -> build\bdist.win32\egg\sans\data_util
+copying build\lib.win32-2.7\sans\data_util\ordereddicttest.py -> build\bdist.win32\egg\sans\data_util
+copying build\lib.win32-2.7\sans\data_util\pathutils.py -> build\bdist.win32\egg\sans\data_util
+copying build\lib.win32-2.7\sans\data_util\registry.py -> build\bdist.win32\egg\sans\data_util
+copying build\lib.win32-2.7\sans\data_util\uncertainty.py -> build\bdist.win32\egg\sans\data_util
+copying build\lib.win32-2.7\sans\data_util\uniquelist.py -> build\bdist.win32\egg\sans\data_util
+copying build\lib.win32-2.7\sans\data_util\__init__.py -> build\bdist.win32\egg\sans\data_util
+creating build\bdist.win32\egg\sans\fit
+copying build\lib.win32-2.7\sans\fit\AbstractFitEngine.py -> build\bdist.win32\egg\sans\fit
+copying build\lib.win32-2.7\sans\fit\BumpsFitting.py -> build\bdist.win32\egg\sans\fit
+copying build\lib.win32-2.7\sans\fit\expression.py -> build\bdist.win32\egg\sans\fit
+copying build\lib.win32-2.7\sans\fit\Fitting.py -> build\bdist.win32\egg\sans\fit
+copying build\lib.win32-2.7\sans\fit\Loader.py -> build\bdist.win32\egg\sans\fit
+copying build\lib.win32-2.7\sans\fit\ParkFitting.py -> build\bdist.win32\egg\sans\fit
+copying build\lib.win32-2.7\sans\fit\ScipyFitting.py -> build\bdist.win32\egg\sans\fit
+copying build\lib.win32-2.7\sans\fit\__init__.py -> build\bdist.win32\egg\sans\fit
+creating build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\aboutbox.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\CategoryInstaller.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\CategoryManager.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\config.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\customdir.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\custom_pstats.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\dataFitting.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\data_manager.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\data_panel.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\data_processor.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\data_state.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\documentation_window.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\dummyapp.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\events.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\gui_manager.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\gui_statusbar.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\gui_style.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\gui_toolbar.py -> build\bdist.win32\egg\sans\guiframe
+creating build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\angles.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\angles_flat.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\ball.icns -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\ball.ico -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\bookmark.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\copy.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\danse_logo.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\drag_arrow.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\drag_hand.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\ess_logo.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\favorites.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\hide.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\house_2.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\ill_logo.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\isis_logo.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\nist_logo.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\nsf_logo.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\paste.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\preview.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\printer.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\redo.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\report.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\reset.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\save.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\search.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\search_pan.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\sns_logo.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\star_plus.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\Thumbs.db -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\umd_logo.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\undo.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\utlogo.gif -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\zoom_in.png -> build\bdist.win32\egg\sans\guiframe\images
+copying build\lib.win32-2.7\sans\guiframe\images\zoom_out.png -> build\bdist.win32\egg\sans\guiframe\images
+creating build\bdist.win32\egg\sans\guiframe\local_perspectives
+creating build\bdist.win32\egg\sans\guiframe\local_perspectives\data_loader
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\data_loader\data_loader.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\data_loader
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\data_loader\help_panel.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\data_loader
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\data_loader\load_thread.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\data_loader
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\data_loader\__init__.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\data_loader
+creating build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\AnnulusSlicer.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\appearanceDialog.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\Arc.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\AzimutSlicer.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\BaseInteractor.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\binder.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\boxMask.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\boxSlicer.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\boxSum.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\detector_dialog.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\Edge.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\graphAppearance.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\help_panel.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\masking.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\Plotter1D.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\Plotter2D.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\plotting.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\profile_dialog.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\sectorMask.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\SectorSlicer.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\SimplePlot.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\slicerpanel.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\SlicerParameters.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\plotting\__init__.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sans\guiframe\local_perspectives\__init__.py -> build\bdist.win32\egg\sans\guiframe\local_perspectives
+creating build\bdist.win32\egg\sans\guiframe\media
+copying build\lib.win32-2.7\sans\guiframe\media\averaging_help.html -> build\bdist.win32\egg\sans\guiframe\media
+copying build\lib.win32-2.7\sans\guiframe\media\change_scale_help.html -> build\bdist.win32\egg\sans\guiframe\media
+copying build\lib.win32-2.7\sans\guiframe\media\data_explorer_help.html -> build\bdist.win32\egg\sans\guiframe\media
+copying build\lib.win32-2.7\sans\guiframe\media\Graph_help.html -> build\bdist.win32\egg\sans\guiframe\media
+copying build\lib.win32-2.7\sans\guiframe\media\guinier_fit.png -> build\bdist.win32\egg\sans\guiframe\media
+copying build\lib.win32-2.7\sans\guiframe\media\hand_menu.png -> build\bdist.win32\egg\sans\guiframe\media
+copying build\lib.win32-2.7\sans\guiframe\media\key_help.html -> build\bdist.win32\egg\sans\guiframe\media
+copying build\lib.win32-2.7\sans\guiframe\media\M_angles_pic.bmp -> build\bdist.win32\egg\sans\guiframe\media
+copying build\lib.win32-2.7\sans\guiframe\panel_base.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\pdfview.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\plugin_base.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\startup_configuration.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\utils.py -> build\bdist.win32\egg\sans\guiframe
+copying build\lib.win32-2.7\sans\guiframe\__init__.py -> build\bdist.win32\egg\sans\guiframe
+creating build\bdist.win32\egg\sans\invariant
+copying build\lib.win32-2.7\sans\invariant\invariant.py -> build\bdist.win32\egg\sans\invariant
+copying build\lib.win32-2.7\sans\invariant\invariant_mapper.py -> build\bdist.win32\egg\sans\invariant
+copying build\lib.win32-2.7\sans\invariant\__init__.py -> build\bdist.win32\egg\sans\invariant
+creating build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\AddComponent.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\BarBellModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\BaseComponent.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\BaseModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\BCCrystalModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\BEPolyelectrolyte.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\BinaryHSModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\BroadPeakModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\CappedCylinderModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\Constant.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\Core2ndMomentModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\CoreFourShellModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\CoreMultiShellModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\CoreShellBicelleModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\CoreShellCylinderModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\CoreShellEllipsoidModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\CoreShellEllipsoidXTModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\CoreShellModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\CorrLengthModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\Cos.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\CSParallelepipedModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\CylinderModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\DABModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\DebyeModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\DiamCylFunc.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\DiamEllipFunc.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\DisperseModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\dispersion_models.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\DivComponent.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\EllipsoidModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\EllipticalCylinderModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\FCCrystalModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\FlexCylEllipXModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\FlexibleCylinderModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\FractalCoreShellModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\FractalModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\FractalO_Z.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\FuzzySphereModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\Gaussian.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\GaussLorentzGelModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\GelFitModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\GuinierModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\GuinierPorodModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\HardsphereStructure.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\HayterMSAStructure.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\HollowCylinderModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\LamellarFFHGModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\LamellarModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\LamellarPCrystalModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\LamellarPSHGModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\LamellarPSModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\LinearPearlsModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\LineModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\LogNormal.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\Lorentzian.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\LorentzModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\MassFractalModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\MassSurfaceFractal.py -> build\bdist.win32\egg\sans\models
+creating build\bdist.win32\egg\sans\models\media
+creating build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\cscylbicelle_pic.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\dm_eq.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\fractcore_eq1.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\fractcore_eq3.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image001.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image002.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image003.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image004.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image005.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image006.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image007.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image008.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image009.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image010.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image011.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image012.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image013.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image014.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image015.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image016.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image017.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image018.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image019.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image020.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image021.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image022.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image023.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image024.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image025.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image026.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image027.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image028.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image029.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image030.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image031.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image032.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image033.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image034.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image035.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image036.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image037.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image038.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image039.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image040.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image041.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image042.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image043.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image044.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image045.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image046.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image047.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image048.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image049.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image050.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image051.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image052.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image053.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image054.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image055.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image056.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image057.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image058.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image059.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image059.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image060.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image060.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image061.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image062.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image063.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image064.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image065.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image066.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image067.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image068.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image069.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image070.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image071.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image072.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image073.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image074.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image075.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image076.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image077.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image078.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image079.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image080.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image081.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image082.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image083.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image084.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image085.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image086.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image087.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image088.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image089.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image090.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image091.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image092.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image093.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image094.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image095.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image096.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image097.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image098.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image099.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image100.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image101.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image102.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image103.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image104.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image105.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image106.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image107.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image108.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image109.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image110.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image111.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image112.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image113.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image114.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image115.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image116.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image117.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image118.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image119.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image119.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image120.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image121.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image122.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image123.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image124.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image124.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image125.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image126.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image126.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image127.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image128.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image128.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image129.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image129.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image130.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image130.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image131.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image131.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image132.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image133.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image134.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image134.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image135.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image136.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image136.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image137.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image138.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image139.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image140.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image141.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image141.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image142.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image143.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image143.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image144.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image145.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image146.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image147.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image148.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image149.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image150.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image151.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image152.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image153.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image154.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image155.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image155.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image156.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image156.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image157.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image158.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image159.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image160.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image161.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image162.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image163.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image164.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image164.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image165.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image165.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image166.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image167.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image168.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image169.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image170.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image171.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image172.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image172.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image173.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image174.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image175.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image176.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image177.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image178.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image179.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image180.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image181.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image182.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image183.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image184.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image185.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image186.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image186.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image187.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image188.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image189.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image190.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image191.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image191.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image192.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image192.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image193.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image194.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image195.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image196.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image197.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image197.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image198.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image199.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image200.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image201.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image202.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image203.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image203.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image204.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image204.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image205.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image206.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image207.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image208.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image209.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image210.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image211.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image212.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image213.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image214.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image215.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image216.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image217.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image218.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image219.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image220.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image221.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image222.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image222.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image223.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image224.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image225.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image225.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image226.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image227.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image228.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image228.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image229.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image230.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image231.bmp -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image232.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image233.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image234.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image235.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image236.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image237.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image238.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image239.PNG -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image240.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\image241.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\linearpearls.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\linearpearl_eq1.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\linearpearl_plot.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\m0x_eq.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\m0y_eq.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\m0z_eq.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\mag_vector.bmp -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\masssurface_fractal_eq1.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\masssurface_fractal_fig1.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\mass_fractal_eq1.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\mass_fractal_fig1.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\mqx.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\mqy.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\mxp.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\myp.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\mzp.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\M_angles_pic.bmp -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\New Picture.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image001.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image002.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image003.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image004.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image005.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image006.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image007.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image008.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image009.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image010.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image011.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image012.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pd_image013.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pearl_eq1.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pearl_eq2.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pearl_eq3.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pearl_eq4.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pearl_eq5.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pearl_eq6.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pearl_eq7.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pearl_fig.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pearl_plot.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pringle-vs-cylinder.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pringle_eqn_1.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\pringle_eqn_2.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\raspberry_pic.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\raspberry_plot.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularHollowPrismInfThinWalls_1.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularHollowPrismInfThinWalls_2.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularHollowPrismInfThinWalls_3.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularHollowPrismInfThinWalls_4.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularHollowPrismInfThinWalls_5.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularHollowPrismInfThinWalls_6.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularHollowPrism_1.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularHollowPrism_2.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularHollowPrism_3.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularHollowPrism_4.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularPrism_1.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularPrism_2.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\RectangularPrism_3.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\secondmeq1.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\secongm_fig1.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sld1.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sld2.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image001.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image002.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image003.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image004.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image005.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image006.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image007.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image008.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image009.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image010.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image011.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image012.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image013.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image014.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image015.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image016.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image017.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image018.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image019.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image020.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image021.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image022.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image023.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image024.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image025.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image026.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image027.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\sm_image028.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\star1.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\star2.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\star3.png -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\surface_fractal_eq1.gif -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\img\surface_fractal_fig1.jpg -> build\bdist.win32\egg\sans\models\media\img
+copying build\lib.win32-2.7\sans\models\media\mag_pic.html -> build\bdist.win32\egg\sans\models\media
+copying build\lib.win32-2.7\sans\models\media\model_functions.html -> build\bdist.win32\egg\sans\models\media
+copying build\lib.win32-2.7\sans\models\media\model_functions.rst -> build\bdist.win32\egg\sans\models\media
+copying build\lib.win32-2.7\sans\models\media\model_functions_v0.rest -> build\bdist.win32\egg\sans\models\media
+copying build\lib.win32-2.7\sans\models\media\NIST_IGOR_SANS_Model_Docs_v4.10.pdf -> build\bdist.win32\egg\sans\models\media
+copying build\lib.win32-2.7\sans\models\media\pd_help.html -> build\bdist.win32\egg\sans\models\media
+copying build\lib.win32-2.7\sans\models\media\polar_mag_help.html -> build\bdist.win32\egg\sans\models\media
+copying build\lib.win32-2.7\sans\models\media\readme.txt -> build\bdist.win32\egg\sans\models\media
+copying build\lib.win32-2.7\sans\models\media\smear_computation.html -> build\bdist.win32\egg\sans\models\media
+copying build\lib.win32-2.7\sans\models\MicelleSphCoreModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\ModelAdaptor.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\MulComponent.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\MultiplicationModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\MultiShellModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\NoStructure.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\NullModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\OnionExpShellModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\OnionModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\ParallelepipedModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\PeakGaussModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\PeakLorentzModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\PearlNecklaceModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\pluginmodel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\PolymerExclVolume.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\Poly_GaussCoil.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\PorodModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\PowerLawAbsModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\PowerLawModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\PringlesModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\qsmearing.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\RaspBerryModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\RectangularHollowPrismInfThinWallsModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\RectangularHollowPrismModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\RectangularPrismModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\ReflAdvModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\ReflectivityIIModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\ReflectivityModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\ReflModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\RPA10Model.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\RPAModel.py -> build\bdist.win32\egg\sans\models
+creating build\bdist.win32\egg\sans\models\sans_extension
+copying build\lib.win32-2.7\sans\models\sans_extension\c_models.pyd -> build\bdist.win32\egg\sans\models\sans_extension
+copying build\lib.win32-2.7\sans\models\sans_extension\sld2i.pyd -> build\bdist.win32\egg\sans\models\sans_extension
+copying build\lib.win32-2.7\sans\models\sans_extension\smearer.pyd -> build\bdist.win32\egg\sans\models\sans_extension
+copying build\lib.win32-2.7\sans\models\sans_extension\smearer2d_helper.pyd -> build\bdist.win32\egg\sans\models\sans_extension
+copying build\lib.win32-2.7\sans\models\sans_extension\__init__.py -> build\bdist.win32\egg\sans\models\sans_extension
+copying build\lib.win32-2.7\sans\models\SCCrystalModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\Schulz.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\SchulzHuber.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\Sin.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\SLDCalFunc.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\smearing_2d.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\SphereModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\SphereSLDModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\SphericalSLDModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\SquareWellStructure.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\StackedDisksModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\StarPolymer.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\StickyHSStructure.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\SubComponent.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\SurfaceFractalModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\TeubnerStreyModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\TriaxialEllipsoidModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\TwoLorentzianModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\TwoPowerLawModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\TwoYukawaModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\UnifiedPowerRgModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\VesicleModel.py -> build\bdist.win32\egg\sans\models
+copying build\lib.win32-2.7\sans\models\__init__.py -> build\bdist.win32\egg\sans\models
+creating build\bdist.win32\egg\sans\perspectives
+creating build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\aperture_editor.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\calculator.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\calculator_widgets.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\collimation_editor.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\console.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\data_editor.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\data_operator.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\density_panel.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\detector_editor.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\gen_scatter_panel.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\help_panel.py -> build\bdist.win32\egg\sans\perspectives\calculator
+creating build\bdist.win32\egg\sans\perspectives\calculator\images
+copying build\lib.win32-2.7\sans\perspectives\calculator\images\ball.icns -> build\bdist.win32\egg\sans\perspectives\calculator\images
+copying build\lib.win32-2.7\sans\perspectives\calculator\images\ball.ico -> build\bdist.win32\egg\sans\perspectives\calculator\images
+copying build\lib.win32-2.7\sans\perspectives\calculator\image_viewer.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\kiessig_calculator_panel.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\load_thread.py -> build\bdist.win32\egg\sans\perspectives\calculator
+creating build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\data_operator_help.html -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\data_oper_pic.png -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\density_calculator_help.html -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\density_tutor.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\dm_eq.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\gen_debye_eq.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\gen_gui_help.bmp -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\gen_i.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\gen_mag_pic.bmp -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\gen_sans_help.html -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\kiessig_calculator_help.html -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\load_image.bmp -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\load_image_help.html -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\mag_vector.bmp -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\mqx.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\mqy.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\mxp.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\myp.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\mzp.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\pdb_combo.jpg -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\pic_convert.bmp -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\pic_plot.bmp -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\pycrust_example.bmp -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\pycrust_help.html -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\q.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\resolution_calculator_help.html -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\resolution_tutor.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\sigma_q.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\sigma_table.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\sld1.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\sld2.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\sld_calculator_help.html -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\slit_calculator_help.html -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\media\v_j.gif -> build\bdist.win32\egg\sans\perspectives\calculator\media
+copying build\lib.win32-2.7\sans\perspectives\calculator\model_editor.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\pyconsole.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\resolcal_thread.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\resolution_calculator_panel.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\sample_editor.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\sld_panel.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\slit_length_calculator_panel.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\source_editor.py -> build\bdist.win32\egg\sans\perspectives\calculator
+copying build\lib.win32-2.7\sans\perspectives\calculator\__init__.py -> build\bdist.win32\egg\sans\perspectives\calculator
+creating build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\basepage.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\batchfitpage.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\console.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\fitpage.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\fitpanel.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\fitproblem.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\fitting.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\fitting_widgets.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\fit_thread.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\ftol_dialog.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\help_panel.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\hint_fitpage.py -> build\bdist.win32\egg\sans\perspectives\fitting
+creating build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\ball.ico -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\batch_button_area.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\batch_help.html -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\category_manager_help.html -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\cat_fig0.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\cat_fig1.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\cat_fig2.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\edit_menu.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\edit_model_menu.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\file_menu.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\glossaryhelp.html -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\help.html -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\key_help.html -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\load_data_help.html -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\model_editor_help.html -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\model_use_help.html -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\new_model.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\plot_button.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\restore_batch_window.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\simultaneous_fit_help.html -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\single_fit_help.html -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\status_bar_help.html -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\sum_model.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\view_button.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\media\view_data_model.bmp -> build\bdist.win32\egg\sans\perspectives\fitting\media
+copying build\lib.win32-2.7\sans\perspectives\fitting\models.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\model_thread.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\pagestate.py -> build\bdist.win32\egg\sans\perspectives\fitting
+creating build\bdist.win32\egg\sans\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sans\perspectives\fitting\plugin_models\polynomial5.py -> build\bdist.win32\egg\sans\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sans\perspectives\fitting\plugin_models\sph_bessel_jn.py -> build\bdist.win32\egg\sans\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sans\perspectives\fitting\plugin_models\sum_Ap1_1_Ap2.py -> build\bdist.win32\egg\sans\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sans\perspectives\fitting\plugin_models\sum_p1_p2.py -> build\bdist.win32\egg\sans\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sans\perspectives\fitting\plugin_models\testmodel.py -> build\bdist.win32\egg\sans\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sans\perspectives\fitting\plugin_models\testmodel_2.py -> build\bdist.win32\egg\sans\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sans\perspectives\fitting\plugin_models\__init__.py -> build\bdist.win32\egg\sans\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sans\perspectives\fitting\report_dialog.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\resultpanel.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\simfitpage.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\utils.py -> build\bdist.win32\egg\sans\perspectives\fitting
+copying build\lib.win32-2.7\sans\perspectives\fitting\__init__.py -> build\bdist.win32\egg\sans\perspectives\fitting
+creating build\bdist.win32\egg\sans\perspectives\invariant
+copying build\lib.win32-2.7\sans\perspectives\invariant\help_panel.py -> build\bdist.win32\egg\sans\perspectives\invariant
+copying build\lib.win32-2.7\sans\perspectives\invariant\invariant.py -> build\bdist.win32\egg\sans\perspectives\invariant
+copying build\lib.win32-2.7\sans\perspectives\invariant\invariant_details.py -> build\bdist.win32\egg\sans\perspectives\invariant
+copying build\lib.win32-2.7\sans\perspectives\invariant\invariant_panel.py -> build\bdist.win32\egg\sans\perspectives\invariant
+copying build\lib.win32-2.7\sans\perspectives\invariant\invariant_state.py -> build\bdist.win32\egg\sans\perspectives\invariant
+copying build\lib.win32-2.7\sans\perspectives\invariant\invariant_widgets.py -> build\bdist.win32\egg\sans\perspectives\invariant
+creating build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\media\bookmark.png -> build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\media\image001.gif -> build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\media\image002.gif -> build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\media\image003.gif -> build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\media\image004.gif -> build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\media\image005.gif -> build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\media\invariant_help.html -> build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\media\redo.png -> build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\media\report.png -> build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\media\report_template.html -> build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\media\save.png -> build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\media\undo.png -> build\bdist.win32\egg\sans\perspectives\invariant\media
+copying build\lib.win32-2.7\sans\perspectives\invariant\report_dialog.py -> build\bdist.win32\egg\sans\perspectives\invariant
+copying build\lib.win32-2.7\sans\perspectives\invariant\__init__.py -> build\bdist.win32\egg\sans\perspectives\invariant
+creating build\bdist.win32\egg\sans\perspectives\pr
+copying build\lib.win32-2.7\sans\perspectives\pr\explore_dialog.py -> build\bdist.win32\egg\sans\perspectives\pr
+copying build\lib.win32-2.7\sans\perspectives\pr\inversion_panel.py -> build\bdist.win32\egg\sans\perspectives\pr
+copying build\lib.win32-2.7\sans\perspectives\pr\inversion_state.py -> build\bdist.win32\egg\sans\perspectives\pr
+copying build\lib.win32-2.7\sans\perspectives\pr\pr.py -> build\bdist.win32\egg\sans\perspectives\pr
+copying build\lib.win32-2.7\sans\perspectives\pr\pr_thread.py -> build\bdist.win32\egg\sans\perspectives\pr
+copying build\lib.win32-2.7\sans\perspectives\pr\pr_widgets.py -> build\bdist.win32\egg\sans\perspectives\pr
+copying build\lib.win32-2.7\sans\perspectives\pr\__init__.py -> build\bdist.win32\egg\sans\perspectives\pr
+copying build\lib.win32-2.7\sans\perspectives\__init__.py -> build\bdist.win32\egg\sans\perspectives
+creating build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\arrow3d.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\BaseInteractor.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\binder.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\canvas.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\config.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\fitDialog.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\fittings.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\LabelDialog.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\LineModel.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\PlotPanel.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\plottables.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\plottable_interactor.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\PropertyDialog.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\SimpleFont.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\SizeDialog.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\TextDialog.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\toolbar.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\transform.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\unitConverter.py -> build\bdist.win32\egg\sans\plottools
+copying build\lib.win32-2.7\sans\plottools\__init__.py -> build\bdist.win32\egg\sans\plottools
+creating build\bdist.win32\egg\sans\pr
+creating build\bdist.win32\egg\sans\pr\core
+copying build\lib.win32-2.7\sans\pr\core\pr_inversion.pyd -> build\bdist.win32\egg\sans\pr\core
+copying build\lib.win32-2.7\sans\pr\core\__init__.py -> build\bdist.win32\egg\sans\pr\core
+copying build\lib.win32-2.7\sans\pr\distance_explorer.py -> build\bdist.win32\egg\sans\pr
+copying build\lib.win32-2.7\sans\pr\invertor.py -> build\bdist.win32\egg\sans\pr
+copying build\lib.win32-2.7\sans\pr\num_term.py -> build\bdist.win32\egg\sans\pr
+copying build\lib.win32-2.7\sans\pr\__init__.py -> build\bdist.win32\egg\sans\pr
+creating build\bdist.win32\egg\sans\sansview
+copying build\lib.win32-2.7\sans\sansview\custom_config.py -> build\bdist.win32\egg\sans\sansview
+copying build\lib.win32-2.7\sans\sansview\default_categories.json -> build\bdist.win32\egg\sans\sansview
+creating build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\angles.png -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\angles_flat.png -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\ball.icns -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\ball.ico -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\danse_logo.png -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\ess_logo.png -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\ill_logo.png -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\isis_logo.png -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\nist_logo.png -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\nsf_logo.png -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\sns_logo.png -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\SVwelcome.png -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\SVwelcome_mini.png -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\umd_logo.png -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\images\utlogo.gif -> build\bdist.win32\egg\sans\sansview\images
+copying build\lib.win32-2.7\sans\sansview\installer_generator.py -> build\bdist.win32\egg\sans\sansview
+copying build\lib.win32-2.7\sans\sansview\local_config.py -> build\bdist.win32\egg\sans\sansview
+creating build\bdist.win32\egg\sans\sansview\media
+copying build\lib.win32-2.7\sans\sansview\media\Tutorial.pdf -> build\bdist.win32\egg\sans\sansview\media
+copying build\lib.win32-2.7\sans\sansview\sansview.py -> build\bdist.win32\egg\sans\sansview
+copying build\lib.win32-2.7\sans\sansview\setup_exe.py -> build\bdist.win32\egg\sans\sansview
+copying build\lib.win32-2.7\sans\sansview\setup_mac.py -> build\bdist.win32\egg\sans\sansview
+creating build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\ testdata_line1.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\1000A_sphere_dsm.xml -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\1000A_sphere_sm.xml -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\2P_New.sans -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\A_Raw_Example-1.omf -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\beam profile.DAT -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\circular_test.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\CoreXY_ShellZ.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\cyl_400_20.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\cyl_400_40.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\cyl_testdata.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\cyl_testdata1.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\cyl_testdata2.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\Dec07031.ASC -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\diamond.pdb -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\dist _THETA_weights.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\dna.pdb -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\exp18_14_igor_2dqxqy.dat -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\fitstate.fitv -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\HiResSAN14.ASC -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\latex_smeared.xml -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\MAR07262.ASC -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\newone.svs -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\PolySpheres.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\prstate.prv -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\P_New.sans -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\SILIC009.ASC -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\SILIC010.DAT -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\SILIC010_noheader.DAT -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\SILIC010_noheader_3col.DAT -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\sld_file.sld -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\sphere_60_q0_2.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\sphere_80.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\test.inv -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\test002.inv -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\testdata_line.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\testdata_line3.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\_phi_weights.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\_radius_dist.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\test\_THETA_weights.txt -> build\bdist.win32\egg\sans\sansview\test
+copying build\lib.win32-2.7\sans\sansview\welcome_panel.py -> build\bdist.win32\egg\sans\sansview
+copying build\lib.win32-2.7\sans\sansview\__init__.py -> build\bdist.win32\egg\sans\sansview
+copying build\lib.win32-2.7\sans\__init__.py -> build\bdist.win32\egg\sans
+creating build\bdist.win32\egg\sas
+creating build\bdist.win32\egg\sas\calculator
+copying build\lib.win32-2.7\sas\calculator\instrument.py -> build\bdist.win32\egg\sas\calculator
+copying build\lib.win32-2.7\sas\calculator\kiessig_calculator.py -> build\bdist.win32\egg\sas\calculator
+copying build\lib.win32-2.7\sas\calculator\resolution_calculator.py -> build\bdist.win32\egg\sas\calculator
+copying build\lib.win32-2.7\sas\calculator\sas_gen.py -> build\bdist.win32\egg\sas\calculator
+copying build\lib.win32-2.7\sas\calculator\slit_length_calculator.py -> build\bdist.win32\egg\sas\calculator
+copying build\lib.win32-2.7\sas\calculator\__init__.py -> build\bdist.win32\egg\sas\calculator
+creating build\bdist.win32\egg\sas\dataloader
+copying build\lib.win32-2.7\sas\dataloader\data_info.py -> build\bdist.win32\egg\sas\dataloader
+copying build\lib.win32-2.7\sas\dataloader\loader.py -> build\bdist.win32\egg\sas\dataloader
+copying build\lib.win32-2.7\sas\dataloader\manipulations.py -> build\bdist.win32\egg\sas\dataloader
+creating build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\abs_reader.py -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\ascii_reader.py -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\associations.py -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\cansas_constants.py -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\cansas_reader.py -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\danse_reader.py -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\defaults.xml -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\hfir1d_reader.py -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\IgorReader.py -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\nexus_reader.py -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\red2d_reader.py -> build\bdist.win32\egg\sas\dataloader\readers
+creating build\bdist.win32\egg\sas\dataloader\readers\schema
+copying build\lib.win32-2.7\sas\dataloader\readers\schema\cansas1d_v1_0.xsd -> build\bdist.win32\egg\sas\dataloader\readers\schema
+copying build\lib.win32-2.7\sas\dataloader\readers\schema\cansas1d_v1_1.xsd -> build\bdist.win32\egg\sas\dataloader\readers\schema
+copying build\lib.win32-2.7\sas\dataloader\readers\tiff_reader.py -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\xml_reader.py -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\readers\__init__.py -> build\bdist.win32\egg\sas\dataloader\readers
+copying build\lib.win32-2.7\sas\dataloader\__init__.py -> build\bdist.win32\egg\sas\dataloader
+creating build\bdist.win32\egg\sas\data_util
+copying build\lib.win32-2.7\sas\data_util\calcthread.py -> build\bdist.win32\egg\sas\data_util
+copying build\lib.win32-2.7\sas\data_util\err1d.py -> build\bdist.win32\egg\sas\data_util
+copying build\lib.win32-2.7\sas\data_util\formatnum.py -> build\bdist.win32\egg\sas\data_util
+copying build\lib.win32-2.7\sas\data_util\nxsunit.py -> build\bdist.win32\egg\sas\data_util
+copying build\lib.win32-2.7\sas\data_util\odict.py -> build\bdist.win32\egg\sas\data_util
+copying build\lib.win32-2.7\sas\data_util\ordereddict.py -> build\bdist.win32\egg\sas\data_util
+copying build\lib.win32-2.7\sas\data_util\ordereddicttest.py -> build\bdist.win32\egg\sas\data_util
+copying build\lib.win32-2.7\sas\data_util\pathutils.py -> build\bdist.win32\egg\sas\data_util
+copying build\lib.win32-2.7\sas\data_util\registry.py -> build\bdist.win32\egg\sas\data_util
+copying build\lib.win32-2.7\sas\data_util\uncertainty.py -> build\bdist.win32\egg\sas\data_util
+copying build\lib.win32-2.7\sas\data_util\uniquelist.py -> build\bdist.win32\egg\sas\data_util
+copying build\lib.win32-2.7\sas\data_util\__init__.py -> build\bdist.win32\egg\sas\data_util
+creating build\bdist.win32\egg\sas\fit
+copying build\lib.win32-2.7\sas\fit\AbstractFitEngine.py -> build\bdist.win32\egg\sas\fit
+copying build\lib.win32-2.7\sas\fit\BumpsFitting.py -> build\bdist.win32\egg\sas\fit
+copying build\lib.win32-2.7\sas\fit\expression.py -> build\bdist.win32\egg\sas\fit
+copying build\lib.win32-2.7\sas\fit\Fitting.py -> build\bdist.win32\egg\sas\fit
+copying build\lib.win32-2.7\sas\fit\Loader.py -> build\bdist.win32\egg\sas\fit
+copying build\lib.win32-2.7\sas\fit\ParkFitting.py -> build\bdist.win32\egg\sas\fit
+copying build\lib.win32-2.7\sas\fit\ScipyFitting.py -> build\bdist.win32\egg\sas\fit
+copying build\lib.win32-2.7\sas\fit\__init__.py -> build\bdist.win32\egg\sas\fit
+creating build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\aboutbox.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\CategoryInstaller.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\CategoryManager.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\config.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\customdir.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\custom_pstats.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\dataFitting.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\data_manager.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\data_panel.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\data_processor.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\data_state.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\documentation_window.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\dummyapp.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\events.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\gui_manager.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\gui_statusbar.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\gui_style.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\gui_toolbar.py -> build\bdist.win32\egg\sas\guiframe
+creating build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\angles.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\angles_flat.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\ball.icns -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\ball.ico -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\bookmark.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\copy.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\danse_logo.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\drag_arrow.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\drag_hand.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\ess_logo.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\favorites.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\hide.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\house_2.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\ill_logo.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\isis_logo.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\nist_logo.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\nsf_logo.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\paste.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\preview.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\printer.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\redo.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\report.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\reset.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\save.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\search.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\search_pan.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\sns_logo.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\star_plus.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\Thumbs.db -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\umd_logo.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\undo.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\utlogo.gif -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\zoom_in.png -> build\bdist.win32\egg\sas\guiframe\images
+copying build\lib.win32-2.7\sas\guiframe\images\zoom_out.png -> build\bdist.win32\egg\sas\guiframe\images
+creating build\bdist.win32\egg\sas\guiframe\local_perspectives
+creating build\bdist.win32\egg\sas\guiframe\local_perspectives\data_loader
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\data_loader\data_loader.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\data_loader
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\data_loader\help_panel.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\data_loader
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\data_loader\load_thread.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\data_loader
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\data_loader\__init__.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\data_loader
+creating build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\AnnulusSlicer.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\appearanceDialog.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\Arc.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\AzimutSlicer.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\BaseInteractor.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\binder.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\boxMask.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\boxSlicer.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\boxSum.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\detector_dialog.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\Edge.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\graphAppearance.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\help_panel.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\masking.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\Plotter1D.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\Plotter2D.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\plotting.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\profile_dialog.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\sectorMask.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\SectorSlicer.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\SimplePlot.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\slicerpanel.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\SlicerParameters.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\plotting\__init__.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting
+copying build\lib.win32-2.7\sas\guiframe\local_perspectives\__init__.py -> build\bdist.win32\egg\sas\guiframe\local_perspectives
+creating build\bdist.win32\egg\sas\guiframe\media
+copying build\lib.win32-2.7\sas\guiframe\media\averaging_help.html -> build\bdist.win32\egg\sas\guiframe\media
+copying build\lib.win32-2.7\sas\guiframe\media\change_scale_help.html -> build\bdist.win32\egg\sas\guiframe\media
+copying build\lib.win32-2.7\sas\guiframe\media\data_explorer_help.html -> build\bdist.win32\egg\sas\guiframe\media
+copying build\lib.win32-2.7\sas\guiframe\media\Graph_help.html -> build\bdist.win32\egg\sas\guiframe\media
+copying build\lib.win32-2.7\sas\guiframe\media\guinier_fit.png -> build\bdist.win32\egg\sas\guiframe\media
+copying build\lib.win32-2.7\sas\guiframe\media\hand_menu.png -> build\bdist.win32\egg\sas\guiframe\media
+copying build\lib.win32-2.7\sas\guiframe\media\key_help.html -> build\bdist.win32\egg\sas\guiframe\media
+copying build\lib.win32-2.7\sas\guiframe\media\M_angles_pic.bmp -> build\bdist.win32\egg\sas\guiframe\media
+copying build\lib.win32-2.7\sas\guiframe\panel_base.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\pdfview.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\plugin_base.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\startup_configuration.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\utils.py -> build\bdist.win32\egg\sas\guiframe
+copying build\lib.win32-2.7\sas\guiframe\__init__.py -> build\bdist.win32\egg\sas\guiframe
+creating build\bdist.win32\egg\sas\invariant
+copying build\lib.win32-2.7\sas\invariant\invariant.py -> build\bdist.win32\egg\sas\invariant
+copying build\lib.win32-2.7\sas\invariant\invariant_mapper.py -> build\bdist.win32\egg\sas\invariant
+copying build\lib.win32-2.7\sas\invariant\__init__.py -> build\bdist.win32\egg\sas\invariant
+creating build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\AddComponent.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\BarBellModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\BaseComponent.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\BaseModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\BCCrystalModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\BEPolyelectrolyte.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\BinaryHSModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\BroadPeakModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\CappedCylinderModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\Constant.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\Core2ndMomentModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\CoreFourShellModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\CoreMultiShellModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\CoreShellBicelleModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\CoreShellCylinderModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\CoreShellEllipsoidModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\CoreShellEllipsoidXTModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\CoreShellModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\CorrLengthModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\Cos.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\CSParallelepipedModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\CylinderModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\DABModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\DebyeModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\DiamCylFunc.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\DiamEllipFunc.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\DisperseModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\dispersion_models.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\DivComponent.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\EllipsoidModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\EllipticalCylinderModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\FCCrystalModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\FlexCylEllipXModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\FlexibleCylinderModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\FractalCoreShellModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\FractalModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\FractalO_Z.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\FuzzySphereModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\Gaussian.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\GaussLorentzGelModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\GelFitModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\GuinierModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\GuinierPorodModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\HardsphereStructure.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\HayterMSAStructure.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\HollowCylinderModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\LamellarFFHGModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\LamellarModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\LamellarPCrystalModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\LamellarPSHGModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\LamellarPSModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\LinearPearlsModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\LineModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\LogNormal.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\Lorentzian.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\LorentzModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\MassFractalModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\MassSurfaceFractal.py -> build\bdist.win32\egg\sas\models
+creating build\bdist.win32\egg\sas\models\media
+creating build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\cscylbicelle_pic.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\dm_eq.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\fractcore_eq1.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\fractcore_eq3.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image001.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image002.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image003.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image004.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image005.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image006.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image007.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image008.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image009.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image010.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image011.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image012.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image013.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image014.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image015.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image016.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image017.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image018.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image019.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image020.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image021.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image022.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image023.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image024.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image025.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image026.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image027.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image028.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image029.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image030.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image031.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image032.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image033.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image034.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image035.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image036.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image037.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image038.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image039.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image040.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image041.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image042.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image043.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image044.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image045.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image046.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image047.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image048.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image049.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image050.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image051.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image052.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image053.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image054.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image055.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image056.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image057.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image058.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image059.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image059.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image060.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image060.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image061.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image062.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image063.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image064.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image065.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image066.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image067.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image068.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image069.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image070.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image071.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image072.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image073.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image074.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image075.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image076.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image077.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image078.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image079.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image080.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image081.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image082.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image083.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image084.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image085.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image086.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image087.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image088.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image089.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image090.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image091.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image092.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image093.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image094.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image095.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image096.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image097.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image098.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image099.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image100.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image101.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image102.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image103.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image104.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image105.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image106.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image107.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image108.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image109.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image110.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image111.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image112.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image113.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image114.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image115.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image116.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image117.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image118.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image119.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image119.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image120.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image121.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image122.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image123.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image124.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image124.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image125.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image126.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image126.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image127.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image128.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image128.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image129.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image129.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image130.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image130.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image131.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image131.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image132.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image133.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image134.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image134.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image135.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image136.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image136.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image137.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image138.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image139.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image140.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image141.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image141.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image142.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image143.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image143.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image144.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image145.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image146.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image147.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image148.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image149.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image150.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image151.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image152.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image153.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image154.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image155.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image155.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image156.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image156.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image157.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image158.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image159.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image160.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image161.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image162.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image163.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image164.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image164.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image165.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image165.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image166.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image167.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image168.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image169.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image170.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image171.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image172.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image172.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image173.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image174.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image175.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image176.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image177.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image178.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image179.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image180.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image181.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image182.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image183.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image184.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image185.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image186.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image186.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image187.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image188.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image189.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image190.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image191.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image191.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image192.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image192.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image193.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image194.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image195.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image196.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image197.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image197.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image198.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image199.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image200.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image201.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image202.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image203.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image203.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image204.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image204.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image205.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image206.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image207.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image208.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image209.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image210.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image211.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image212.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image213.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image214.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image215.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image216.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image217.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image218.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image219.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image220.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image221.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image222.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image222.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image223.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image224.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image225.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image225.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image226.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image227.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image228.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image228.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image229.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image230.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image231.bmp -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image232.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image233.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image234.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image235.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image236.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image237.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image238.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image239.PNG -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image240.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\image241.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\linearpearls.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\linearpearl_eq1.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\linearpearl_plot.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\m0x_eq.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\m0y_eq.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\m0z_eq.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\mag_vector.bmp -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\masssurface_fractal_eq1.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\masssurface_fractal_fig1.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\mass_fractal_eq1.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\mass_fractal_fig1.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\mqx.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\mqy.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\mxp.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\myp.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\mzp.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\M_angles_pic.bmp -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\New Picture.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image001.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image002.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image003.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image004.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image005.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image006.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image007.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image008.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image009.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image010.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image011.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image012.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pd_image013.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pearl_eq1.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pearl_eq2.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pearl_eq3.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pearl_eq4.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pearl_eq5.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pearl_eq6.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pearl_eq7.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pearl_fig.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pearl_plot.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pringle-vs-cylinder.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pringle_eqn_1.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\pringle_eqn_2.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\raspberry_pic.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\raspberry_plot.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularHollowPrismInfThinWalls_1.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularHollowPrismInfThinWalls_2.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularHollowPrismInfThinWalls_3.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularHollowPrismInfThinWalls_4.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularHollowPrismInfThinWalls_5.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularHollowPrismInfThinWalls_6.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularHollowPrism_1.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularHollowPrism_2.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularHollowPrism_3.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularHollowPrism_4.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularPrism_1.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularPrism_2.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\RectangularPrism_3.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\secondmeq1.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\secongm_fig1.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sld1.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sld2.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image001.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image002.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image003.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image004.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image005.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image006.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image007.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image008.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image009.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image010.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image011.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image012.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image013.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image014.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image015.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image016.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image017.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image018.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image019.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image020.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image021.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image022.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image023.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image024.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image025.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image026.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image027.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\sm_image028.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\star1.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\star2.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\star3.png -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\surface_fractal_eq1.gif -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\img\surface_fractal_fig1.jpg -> build\bdist.win32\egg\sas\models\media\img
+copying build\lib.win32-2.7\sas\models\media\mag_pic.html -> build\bdist.win32\egg\sas\models\media
+copying build\lib.win32-2.7\sas\models\media\model_functions.html -> build\bdist.win32\egg\sas\models\media
+copying build\lib.win32-2.7\sas\models\media\model_functions.rst -> build\bdist.win32\egg\sas\models\media
+copying build\lib.win32-2.7\sas\models\media\model_functions_v0.rest -> build\bdist.win32\egg\sas\models\media
+copying build\lib.win32-2.7\sas\models\media\NIST_IGOR_SANS_Model_Docs_v4.10.pdf -> build\bdist.win32\egg\sas\models\media
+copying build\lib.win32-2.7\sas\models\media\pd_help.html -> build\bdist.win32\egg\sas\models\media
+copying build\lib.win32-2.7\sas\models\media\polar_mag_help.html -> build\bdist.win32\egg\sas\models\media
+copying build\lib.win32-2.7\sas\models\media\readme.txt -> build\bdist.win32\egg\sas\models\media
+copying build\lib.win32-2.7\sas\models\media\smear_computation.html -> build\bdist.win32\egg\sas\models\media
+copying build\lib.win32-2.7\sas\models\MicelleSphCoreModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\ModelAdaptor.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\MulComponent.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\MultiplicationModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\MultiShellModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\NoStructure.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\NullModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\OnionExpShellModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\OnionModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\ParallelepipedModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\PeakGaussModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\PeakLorentzModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\PearlNecklaceModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\pluginmodel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\PolymerExclVolume.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\Poly_GaussCoil.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\PorodModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\PowerLawAbsModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\PowerLawModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\PringlesModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\qsmearing.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\RaspBerryModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\RectangularHollowPrismInfThinWallsModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\RectangularHollowPrismModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\RectangularPrismModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\ReflAdvModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\ReflectivityIIModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\ReflectivityModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\ReflModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\RPA10Model.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\RPAModel.py -> build\bdist.win32\egg\sas\models
+creating build\bdist.win32\egg\sas\models\sas_extension
+copying build\lib.win32-2.7\sas\models\sas_extension\c_models.pyd -> build\bdist.win32\egg\sas\models\sas_extension
+copying build\lib.win32-2.7\sas\models\sas_extension\sld2i.pyd -> build\bdist.win32\egg\sas\models\sas_extension
+copying build\lib.win32-2.7\sas\models\sas_extension\smearer.pyd -> build\bdist.win32\egg\sas\models\sas_extension
+copying build\lib.win32-2.7\sas\models\sas_extension\smearer2d_helper.pyd -> build\bdist.win32\egg\sas\models\sas_extension
+copying build\lib.win32-2.7\sas\models\sas_extension\__init__.py -> build\bdist.win32\egg\sas\models\sas_extension
+copying build\lib.win32-2.7\sas\models\SCCrystalModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\Schulz.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\Sin.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\SLDCalFunc.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\smearing_2d.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\SphereModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\SphereSLDModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\SphericalSLDModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\SquareWellStructure.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\StackedDisksModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\StarPolymer.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\StickyHSStructure.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\SubComponent.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\SurfaceFractalModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\TeubnerStreyModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\TriaxialEllipsoidModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\TwoLorentzianModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\TwoPowerLawModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\TwoYukawaModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\UnifiedPowerRgModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\VesicleModel.py -> build\bdist.win32\egg\sas\models
+copying build\lib.win32-2.7\sas\models\__init__.py -> build\bdist.win32\egg\sas\models
+creating build\bdist.win32\egg\sas\perspectives
+creating build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\aperture_editor.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\calculator.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\calculator_widgets.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\collimation_editor.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\console.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\data_editor.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\data_operator.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\density_panel.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\detector_editor.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\gen_scatter_panel.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\help_panel.py -> build\bdist.win32\egg\sas\perspectives\calculator
+creating build\bdist.win32\egg\sas\perspectives\calculator\images
+copying build\lib.win32-2.7\sas\perspectives\calculator\images\ball.icns -> build\bdist.win32\egg\sas\perspectives\calculator\images
+copying build\lib.win32-2.7\sas\perspectives\calculator\images\ball.ico -> build\bdist.win32\egg\sas\perspectives\calculator\images
+copying build\lib.win32-2.7\sas\perspectives\calculator\image_viewer.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\kiessig_calculator_panel.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\load_thread.py -> build\bdist.win32\egg\sas\perspectives\calculator
+creating build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\data_operator_help.html -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\data_oper_pic.png -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\density_calculator_help.html -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\density_tutor.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\dm_eq.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\gen_debye_eq.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\gen_gui_help.bmp -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\gen_i.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\gen_mag_pic.bmp -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\gen_sas_help.html -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\kiessig_calculator_help.html -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\load_image.bmp -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\load_image_help.html -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\mag_vector.bmp -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\mqx.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\mqy.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\mxp.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\myp.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\mzp.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\pdb_combo.jpg -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\pic_convert.bmp -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\pic_plot.bmp -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\pycrust_example.bmp -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\pycrust_help.html -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\q.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\resolution_calculator_help.html -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\resolution_tutor.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\sigma_q.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\sigma_table.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\sld1.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\sld2.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\sld_calculator_help.html -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\slit_calculator_help.html -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\media\v_j.gif -> build\bdist.win32\egg\sas\perspectives\calculator\media
+copying build\lib.win32-2.7\sas\perspectives\calculator\model_editor.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\pyconsole.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\resolcal_thread.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\resolution_calculator_panel.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\sample_editor.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\sld_panel.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\slit_length_calculator_panel.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\source_editor.py -> build\bdist.win32\egg\sas\perspectives\calculator
+copying build\lib.win32-2.7\sas\perspectives\calculator\__init__.py -> build\bdist.win32\egg\sas\perspectives\calculator
+creating build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\basepage.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\batchfitpage.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\console.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\fitpage.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\fitpanel.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\fitproblem.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\fitting.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\fitting_widgets.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\fit_thread.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\ftol_dialog.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\help_panel.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\hint_fitpage.py -> build\bdist.win32\egg\sas\perspectives\fitting
+creating build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\ball.ico -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\batch_button_area.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\batch_help.html -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\category_manager_help.html -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\cat_fig0.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\cat_fig1.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\cat_fig2.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\edit_menu.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\edit_model_menu.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\file_menu.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\glossaryhelp.html -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\help.html -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\key_help.html -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\load_data_help.html -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\model_editor_help.html -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\model_use_help.html -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\new_model.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\plot_button.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\restore_batch_window.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\simultaneous_fit_help.html -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\single_fit_help.html -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\status_bar_help.html -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\sum_model.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\view_button.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\media\view_data_model.bmp -> build\bdist.win32\egg\sas\perspectives\fitting\media
+copying build\lib.win32-2.7\sas\perspectives\fitting\models.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\model_thread.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\pagestate.py -> build\bdist.win32\egg\sas\perspectives\fitting
+creating build\bdist.win32\egg\sas\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sas\perspectives\fitting\plugin_models\polynomial5.py -> build\bdist.win32\egg\sas\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sas\perspectives\fitting\plugin_models\sph_bessel_jn.py -> build\bdist.win32\egg\sas\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sas\perspectives\fitting\plugin_models\sum_Ap1_1_Ap2.py -> build\bdist.win32\egg\sas\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sas\perspectives\fitting\plugin_models\sum_p1_p2.py -> build\bdist.win32\egg\sas\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sas\perspectives\fitting\plugin_models\testmodel.py -> build\bdist.win32\egg\sas\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sas\perspectives\fitting\plugin_models\testmodel_2.py -> build\bdist.win32\egg\sas\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sas\perspectives\fitting\plugin_models\__init__.py -> build\bdist.win32\egg\sas\perspectives\fitting\plugin_models
+copying build\lib.win32-2.7\sas\perspectives\fitting\report_dialog.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\resultpanel.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\simfitpage.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\utils.py -> build\bdist.win32\egg\sas\perspectives\fitting
+copying build\lib.win32-2.7\sas\perspectives\fitting\__init__.py -> build\bdist.win32\egg\sas\perspectives\fitting
+creating build\bdist.win32\egg\sas\perspectives\invariant
+copying build\lib.win32-2.7\sas\perspectives\invariant\help_panel.py -> build\bdist.win32\egg\sas\perspectives\invariant
+copying build\lib.win32-2.7\sas\perspectives\invariant\invariant.py -> build\bdist.win32\egg\sas\perspectives\invariant
+copying build\lib.win32-2.7\sas\perspectives\invariant\invariant_details.py -> build\bdist.win32\egg\sas\perspectives\invariant
+copying build\lib.win32-2.7\sas\perspectives\invariant\invariant_panel.py -> build\bdist.win32\egg\sas\perspectives\invariant
+copying build\lib.win32-2.7\sas\perspectives\invariant\invariant_state.py -> build\bdist.win32\egg\sas\perspectives\invariant
+copying build\lib.win32-2.7\sas\perspectives\invariant\invariant_widgets.py -> build\bdist.win32\egg\sas\perspectives\invariant
+creating build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\media\bookmark.png -> build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\media\image001.gif -> build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\media\image002.gif -> build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\media\image003.gif -> build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\media\image004.gif -> build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\media\image005.gif -> build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\media\invariant_help.html -> build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\media\redo.png -> build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\media\report.png -> build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\media\report_template.html -> build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\media\save.png -> build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\media\undo.png -> build\bdist.win32\egg\sas\perspectives\invariant\media
+copying build\lib.win32-2.7\sas\perspectives\invariant\report_dialog.py -> build\bdist.win32\egg\sas\perspectives\invariant
+copying build\lib.win32-2.7\sas\perspectives\invariant\__init__.py -> build\bdist.win32\egg\sas\perspectives\invariant
+creating build\bdist.win32\egg\sas\perspectives\pr
+copying build\lib.win32-2.7\sas\perspectives\pr\explore_dialog.py -> build\bdist.win32\egg\sas\perspectives\pr
+copying build\lib.win32-2.7\sas\perspectives\pr\inversion_panel.py -> build\bdist.win32\egg\sas\perspectives\pr
+copying build\lib.win32-2.7\sas\perspectives\pr\inversion_state.py -> build\bdist.win32\egg\sas\perspectives\pr
+copying build\lib.win32-2.7\sas\perspectives\pr\pr.py -> build\bdist.win32\egg\sas\perspectives\pr
+copying build\lib.win32-2.7\sas\perspectives\pr\pr_thread.py -> build\bdist.win32\egg\sas\perspectives\pr
+copying build\lib.win32-2.7\sas\perspectives\pr\pr_widgets.py -> build\bdist.win32\egg\sas\perspectives\pr
+copying build\lib.win32-2.7\sas\perspectives\pr\__init__.py -> build\bdist.win32\egg\sas\perspectives\pr
+copying build\lib.win32-2.7\sas\perspectives\__init__.py -> build\bdist.win32\egg\sas\perspectives
+creating build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\arrow3d.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\BaseInteractor.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\binder.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\canvas.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\config.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\fitDialog.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\fittings.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\LabelDialog.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\LineModel.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\PlotPanel.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\plottables.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\plottable_interactor.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\PropertyDialog.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\SimpleFont.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\SizeDialog.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\TextDialog.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\toolbar.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\transform.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\unitConverter.py -> build\bdist.win32\egg\sas\plottools
+copying build\lib.win32-2.7\sas\plottools\__init__.py -> build\bdist.win32\egg\sas\plottools
+creating build\bdist.win32\egg\sas\pr
+creating build\bdist.win32\egg\sas\pr\core
+copying build\lib.win32-2.7\sas\pr\core\pr_inversion.pyd -> build\bdist.win32\egg\sas\pr\core
+copying build\lib.win32-2.7\sas\pr\core\__init__.py -> build\bdist.win32\egg\sas\pr\core
+copying build\lib.win32-2.7\sas\pr\distance_explorer.py -> build\bdist.win32\egg\sas\pr
+copying build\lib.win32-2.7\sas\pr\invertor.py -> build\bdist.win32\egg\sas\pr
+copying build\lib.win32-2.7\sas\pr\num_term.py -> build\bdist.win32\egg\sas\pr
+copying build\lib.win32-2.7\sas\pr\__init__.py -> build\bdist.win32\egg\sas\pr
+creating build\bdist.win32\egg\sas\sasview
+copying build\lib.win32-2.7\sas\sasview\custom_config.py -> build\bdist.win32\egg\sas\sasview
+copying build\lib.win32-2.7\sas\sasview\default_categories.json -> build\bdist.win32\egg\sas\sasview
+creating build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\angles.png -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\angles_flat.png -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\ball.icns -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\ball.ico -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\danse_logo.png -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\ess_logo.png -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\ill_logo.png -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\isis_logo.png -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\nist_logo.png -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\nsf_logo.png -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\sns_logo.png -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\SVwelcome.png -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\SVwelcome_mini.png -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\umd_logo.png -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\images\utlogo.gif -> build\bdist.win32\egg\sas\sasview\images
+copying build\lib.win32-2.7\sas\sasview\installer_generator.py -> build\bdist.win32\egg\sas\sasview
+copying build\lib.win32-2.7\sas\sasview\local_config.py -> build\bdist.win32\egg\sas\sasview
+creating build\bdist.win32\egg\sas\sasview\media
+copying build\lib.win32-2.7\sas\sasview\media\Tutorial.pdf -> build\bdist.win32\egg\sas\sasview\media
+copying build\lib.win32-2.7\sas\sasview\sasview.py -> build\bdist.win32\egg\sas\sasview
+copying build\lib.win32-2.7\sas\sasview\setup_exe.py -> build\bdist.win32\egg\sas\sasview
+copying build\lib.win32-2.7\sas\sasview\setup_mac.py -> build\bdist.win32\egg\sas\sasview
+creating build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\ testdata_line1.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\1000A_sphere_dsm.xml -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\1000A_sphere_sm.xml -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\2P_New.sans -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\A_Raw_Example-1.omf -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\beam profile.DAT -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\circular_test.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\CoreXY_ShellZ.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\cyl_400_20.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\cyl_400_40.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\cyl_testdata.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\cyl_testdata1.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\cyl_testdata2.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\Dec07031.ASC -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\diamond.pdb -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\dist _THETA_weights.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\dna.pdb -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\exp18_14_igor_2dqxqy.dat -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\fitstate.fitv -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\HiResSAN14.ASC -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\latex_smeared.xml -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\MAR07262.ASC -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\newone.svs -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\PolySpheres.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\prstate.prv -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\P_New.sans -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\SILIC009.ASC -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\SILIC010.DAT -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\SILIC010_noheader.DAT -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\SILIC010_noheader_3col.DAT -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\sld_file.sld -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\sphere_60_q0_2.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\sphere_80.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\test.inv -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\test002.inv -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\testdata_line.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\testdata_line3.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\_phi_weights.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\_radius_dist.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\test\_THETA_weights.txt -> build\bdist.win32\egg\sas\sasview\test
+copying build\lib.win32-2.7\sas\sasview\welcome_panel.py -> build\bdist.win32\egg\sas\sasview
+copying build\lib.win32-2.7\sas\sasview\__init__.py -> build\bdist.win32\egg\sas\sasview
+copying build\lib.win32-2.7\sas\__init__.py -> build\bdist.win32\egg\sas
+byte-compiling build\bdist.win32\egg\park\assembly.py to assembly.pyc
+byte-compiling build\bdist.win32\egg\park\data.py to data.pyc
+byte-compiling build\bdist.win32\egg\park\deps.py to deps.pyc
+byte-compiling build\bdist.win32\egg\park\diffev.py to diffev.pyc
+byte-compiling build\bdist.win32\egg\park\expression.py to expression.pyc
+byte-compiling build\bdist.win32\egg\park\fit.py to fit.pyc
+byte-compiling build\bdist.win32\egg\park\fitmc.py to fitmc.pyc
+byte-compiling build\bdist.win32\egg\park\fitresult.py to fitresult.pyc
+byte-compiling build\bdist.win32\egg\park\fitservice.py to fitservice.pyc
+byte-compiling build\bdist.win32\egg\park\formatnum.py to formatnum.pyc
+byte-compiling build\bdist.win32\egg\park\message.py to message.pyc
+byte-compiling build\bdist.win32\egg\park\model.py to model.pyc
+byte-compiling build\bdist.win32\egg\park\monitor.py to monitor.pyc
+byte-compiling build\bdist.win32\egg\park\parameter.py to parameter.pyc
+byte-compiling build\bdist.win32\egg\park\parkde.py to parkde.pyc
+byte-compiling build\bdist.win32\egg\park\parksnob.py to parksnob.pyc
+byte-compiling build\bdist.win32\egg\park\peaks.py to peaks.pyc
+byte-compiling build\bdist.win32\egg\park\pmap.py to pmap.pyc
+byte-compiling build\bdist.win32\egg\park\rangemap.py to rangemap.pyc
+byte-compiling build\bdist.win32\egg\park\serial.py to serial.pyc
+byte-compiling build\bdist.win32\egg\park\setup.py to setup.pyc
+byte-compiling build\bdist.win32\egg\park\simplex.py to simplex.pyc
+byte-compiling build\bdist.win32\egg\park\version.py to version.pyc
+byte-compiling build\bdist.win32\egg\park\wxmonitor.py to wxmonitor.pyc
+byte-compiling build\bdist.win32\egg\park\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\calculator\instrument.py to instrument.pyc
+byte-compiling build\bdist.win32\egg\sans\calculator\kiessig_calculator.py to kiessig_calculator.pyc
+byte-compiling build\bdist.win32\egg\sans\calculator\resolution_calculator.py to resolution_calculator.pyc
+byte-compiling build\bdist.win32\egg\sans\calculator\sans_gen.py to sans_gen.pyc
+byte-compiling build\bdist.win32\egg\sans\calculator\slit_length_calculator.py to slit_length_calculator.pyc
+byte-compiling build\bdist.win32\egg\sans\calculator\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\data_info.py to data_info.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\loader.py to loader.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\manipulations.py to manipulations.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\abs_reader.py to abs_reader.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\ascii_reader.py to ascii_reader.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\associations.py to associations.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\cansas_constants.py to cansas_constants.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\cansas_reader.py to cansas_reader.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\danse_reader.py to danse_reader.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\hfir1d_reader.py to hfir1d_reader.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\IgorReader.py to IgorReader.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\nexus_reader.py to nexus_reader.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\red2d_reader.py to red2d_reader.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\tiff_reader.py to tiff_reader.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\xml_reader.py to xml_reader.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\readers\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\dataloader\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\data_util\calcthread.py to calcthread.pyc
+byte-compiling build\bdist.win32\egg\sans\data_util\err1d.py to err1d.pyc
+byte-compiling build\bdist.win32\egg\sans\data_util\formatnum.py to formatnum.pyc
+byte-compiling build\bdist.win32\egg\sans\data_util\nxsunit.py to nxsunit.pyc
+byte-compiling build\bdist.win32\egg\sans\data_util\odict.py to odict.pyc
+byte-compiling build\bdist.win32\egg\sans\data_util\ordereddict.py to ordereddict.pyc
+byte-compiling build\bdist.win32\egg\sans\data_util\ordereddicttest.py to ordereddicttest.pyc
+byte-compiling build\bdist.win32\egg\sans\data_util\pathutils.py to pathutils.pyc
+byte-compiling build\bdist.win32\egg\sans\data_util\registry.py to registry.pyc
+byte-compiling build\bdist.win32\egg\sans\data_util\uncertainty.py to uncertainty.pyc
+byte-compiling build\bdist.win32\egg\sans\data_util\uniquelist.py to uniquelist.pyc
+byte-compiling build\bdist.win32\egg\sans\data_util\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\fit\AbstractFitEngine.py to AbstractFitEngine.pyc
+byte-compiling build\bdist.win32\egg\sans\fit\BumpsFitting.py to BumpsFitting.pyc
+byte-compiling build\bdist.win32\egg\sans\fit\expression.py to expression.pyc
+byte-compiling build\bdist.win32\egg\sans\fit\Fitting.py to Fitting.pyc
+byte-compiling build\bdist.win32\egg\sans\fit\Loader.py to Loader.pyc
+byte-compiling build\bdist.win32\egg\sans\fit\ParkFitting.py to ParkFitting.pyc
+byte-compiling build\bdist.win32\egg\sans\fit\ScipyFitting.py to ScipyFitting.pyc
+byte-compiling build\bdist.win32\egg\sans\fit\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\aboutbox.py to aboutbox.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\CategoryInstaller.py to CategoryInstaller.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\CategoryManager.py to CategoryManager.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\config.py to config.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\customdir.py to customdir.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\custom_pstats.py to custom_pstats.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\dataFitting.py to dataFitting.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\data_manager.py to data_manager.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\data_panel.py to data_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\data_processor.py to data_processor.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\data_state.py to data_state.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\documentation_window.py to documentation_window.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\dummyapp.py to dummyapp.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\events.py to events.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\gui_manager.py to gui_manager.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\gui_statusbar.py to gui_statusbar.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\gui_style.py to gui_style.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\gui_toolbar.py to gui_toolbar.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\data_loader\data_loader.py to data_loader.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\data_loader\help_panel.py to help_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\data_loader\load_thread.py to load_thread.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\data_loader\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\AnnulusSlicer.py to AnnulusSlicer.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\appearanceDialog.py to appearanceDialog.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\Arc.py to Arc.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\AzimutSlicer.py to AzimutSlicer.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\BaseInteractor.py to BaseInteractor.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\binder.py to binder.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\boxMask.py to boxMask.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\boxSlicer.py to boxSlicer.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\boxSum.py to boxSum.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\detector_dialog.py to detector_dialog.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\Edge.py to Edge.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\graphAppearance.py to graphAppearance.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\help_panel.py to help_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\masking.py to masking.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\Plotter1D.py to Plotter1D.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\Plotter2D.py to Plotter2D.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\plotting.py to plotting.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\profile_dialog.py to profile_dialog.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\sectorMask.py to sectorMask.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\SectorSlicer.py to SectorSlicer.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\SimplePlot.py to SimplePlot.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\slicerpanel.py to slicerpanel.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\SlicerParameters.py to SlicerParameters.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\plotting\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\local_perspectives\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\panel_base.py to panel_base.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\pdfview.py to pdfview.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\plugin_base.py to plugin_base.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\startup_configuration.py to startup_configuration.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\utils.py to utils.pyc
+byte-compiling build\bdist.win32\egg\sans\guiframe\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\invariant\invariant.py to invariant.pyc
+byte-compiling build\bdist.win32\egg\sans\invariant\invariant_mapper.py to invariant_mapper.pyc
+byte-compiling build\bdist.win32\egg\sans\invariant\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\models\AddComponent.py to AddComponent.pyc
+byte-compiling build\bdist.win32\egg\sans\models\BarBellModel.py to BarBellModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\BaseComponent.py to BaseComponent.pyc
+byte-compiling build\bdist.win32\egg\sans\models\BaseModel.py to BaseModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\BCCrystalModel.py to BCCrystalModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\BEPolyelectrolyte.py to BEPolyelectrolyte.pyc
+byte-compiling build\bdist.win32\egg\sans\models\BinaryHSModel.py to BinaryHSModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\BroadPeakModel.py to BroadPeakModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\CappedCylinderModel.py to CappedCylinderModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\Constant.py to Constant.pyc
+byte-compiling build\bdist.win32\egg\sans\models\Core2ndMomentModel.py to Core2ndMomentModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\CoreFourShellModel.py to CoreFourShellModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\CoreMultiShellModel.py to CoreMultiShellModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\CoreShellBicelleModel.py to CoreShellBicelleModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\CoreShellCylinderModel.py to CoreShellCylinderModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\CoreShellEllipsoidModel.py to CoreShellEllipsoidModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\CoreShellEllipsoidXTModel.py to CoreShellEllipsoidXTModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\CoreShellModel.py to CoreShellModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\CorrLengthModel.py to CorrLengthModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\Cos.py to Cos.pyc
+byte-compiling build\bdist.win32\egg\sans\models\CSParallelepipedModel.py to CSParallelepipedModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\CylinderModel.py to CylinderModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\DABModel.py to DABModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\DebyeModel.py to DebyeModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\DiamCylFunc.py to DiamCylFunc.pyc
+byte-compiling build\bdist.win32\egg\sans\models\DiamEllipFunc.py to DiamEllipFunc.pyc
+byte-compiling build\bdist.win32\egg\sans\models\DisperseModel.py to DisperseModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\dispersion_models.py to dispersion_models.pyc
+byte-compiling build\bdist.win32\egg\sans\models\DivComponent.py to DivComponent.pyc
+byte-compiling build\bdist.win32\egg\sans\models\EllipsoidModel.py to EllipsoidModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\EllipticalCylinderModel.py to EllipticalCylinderModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\FCCrystalModel.py to FCCrystalModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\FlexCylEllipXModel.py to FlexCylEllipXModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\FlexibleCylinderModel.py to FlexibleCylinderModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\FractalCoreShellModel.py to FractalCoreShellModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\FractalModel.py to FractalModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\FractalO_Z.py to FractalO_Z.pyc
+byte-compiling build\bdist.win32\egg\sans\models\FuzzySphereModel.py to FuzzySphereModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\Gaussian.py to Gaussian.pyc
+byte-compiling build\bdist.win32\egg\sans\models\GaussLorentzGelModel.py to GaussLorentzGelModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\GelFitModel.py to GelFitModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\GuinierModel.py to GuinierModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\GuinierPorodModel.py to GuinierPorodModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\HardsphereStructure.py to HardsphereStructure.pyc
+byte-compiling build\bdist.win32\egg\sans\models\HayterMSAStructure.py to HayterMSAStructure.pyc
+byte-compiling build\bdist.win32\egg\sans\models\HollowCylinderModel.py to HollowCylinderModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\LamellarFFHGModel.py to LamellarFFHGModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\LamellarModel.py to LamellarModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\LamellarPCrystalModel.py to LamellarPCrystalModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\LamellarPSHGModel.py to LamellarPSHGModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\LamellarPSModel.py to LamellarPSModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\LinearPearlsModel.py to LinearPearlsModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\LineModel.py to LineModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\LogNormal.py to LogNormal.pyc
+byte-compiling build\bdist.win32\egg\sans\models\Lorentzian.py to Lorentzian.pyc
+byte-compiling build\bdist.win32\egg\sans\models\LorentzModel.py to LorentzModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\MassFractalModel.py to MassFractalModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\MassSurfaceFractal.py to MassSurfaceFractal.pyc
+byte-compiling build\bdist.win32\egg\sans\models\MicelleSphCoreModel.py to MicelleSphCoreModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\ModelAdaptor.py to ModelAdaptor.pyc
+byte-compiling build\bdist.win32\egg\sans\models\MulComponent.py to MulComponent.pyc
+byte-compiling build\bdist.win32\egg\sans\models\MultiplicationModel.py to MultiplicationModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\MultiShellModel.py to MultiShellModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\NoStructure.py to NoStructure.pyc
+byte-compiling build\bdist.win32\egg\sans\models\NullModel.py to NullModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\OnionExpShellModel.py to OnionExpShellModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\OnionModel.py to OnionModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\ParallelepipedModel.py to ParallelepipedModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\PeakGaussModel.py to PeakGaussModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\PeakLorentzModel.py to PeakLorentzModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\PearlNecklaceModel.py to PearlNecklaceModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\pluginmodel.py to pluginmodel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\PolymerExclVolume.py to PolymerExclVolume.pyc
+byte-compiling build\bdist.win32\egg\sans\models\Poly_GaussCoil.py to Poly_GaussCoil.pyc
+byte-compiling build\bdist.win32\egg\sans\models\PorodModel.py to PorodModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\PowerLawAbsModel.py to PowerLawAbsModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\PowerLawModel.py to PowerLawModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\PringlesModel.py to PringlesModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\qsmearing.py to qsmearing.pyc
+byte-compiling build\bdist.win32\egg\sans\models\RaspBerryModel.py to RaspBerryModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\RectangularHollowPrismInfThinWallsModel.py to RectangularHollowPrismInfThinWallsModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\RectangularHollowPrismModel.py to RectangularHollowPrismModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\RectangularPrismModel.py to RectangularPrismModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\ReflAdvModel.py to ReflAdvModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\ReflectivityIIModel.py to ReflectivityIIModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\ReflectivityModel.py to ReflectivityModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\ReflModel.py to ReflModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\RPA10Model.py to RPA10Model.pyc
+byte-compiling build\bdist.win32\egg\sans\models\RPAModel.py to RPAModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\sans_extension\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\models\SCCrystalModel.py to SCCrystalModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\Schulz.py to Schulz.pyc
+byte-compiling build\bdist.win32\egg\sans\models\SchulzHuber.py to SchulzHuber.pyc
+byte-compiling build\bdist.win32\egg\sans\models\Sin.py to Sin.pyc
+byte-compiling build\bdist.win32\egg\sans\models\SLDCalFunc.py to SLDCalFunc.pyc
+byte-compiling build\bdist.win32\egg\sans\models\smearing_2d.py to smearing_2d.pyc
+byte-compiling build\bdist.win32\egg\sans\models\SphereModel.py to SphereModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\SphereSLDModel.py to SphereSLDModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\SphericalSLDModel.py to SphericalSLDModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\SquareWellStructure.py to SquareWellStructure.pyc
+byte-compiling build\bdist.win32\egg\sans\models\StackedDisksModel.py to StackedDisksModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\StarPolymer.py to StarPolymer.pyc
+byte-compiling build\bdist.win32\egg\sans\models\StickyHSStructure.py to StickyHSStructure.pyc
+byte-compiling build\bdist.win32\egg\sans\models\SubComponent.py to SubComponent.pyc
+byte-compiling build\bdist.win32\egg\sans\models\SurfaceFractalModel.py to SurfaceFractalModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\TeubnerStreyModel.py to TeubnerStreyModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\TriaxialEllipsoidModel.py to TriaxialEllipsoidModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\TwoLorentzianModel.py to TwoLorentzianModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\TwoPowerLawModel.py to TwoPowerLawModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\TwoYukawaModel.py to TwoYukawaModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\UnifiedPowerRgModel.py to UnifiedPowerRgModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\VesicleModel.py to VesicleModel.pyc
+byte-compiling build\bdist.win32\egg\sans\models\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\aperture_editor.py to aperture_editor.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\calculator.py to calculator.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\calculator_widgets.py to calculator_widgets.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\collimation_editor.py to collimation_editor.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\console.py to console.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\data_editor.py to data_editor.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\data_operator.py to data_operator.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\density_panel.py to density_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\detector_editor.py to detector_editor.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\gen_scatter_panel.py to gen_scatter_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\help_panel.py to help_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\image_viewer.py to image_viewer.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\kiessig_calculator_panel.py to kiessig_calculator_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\load_thread.py to load_thread.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\model_editor.py to model_editor.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\pyconsole.py to pyconsole.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\resolcal_thread.py to resolcal_thread.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\resolution_calculator_panel.py to resolution_calculator_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\sample_editor.py to sample_editor.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\sld_panel.py to sld_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\slit_length_calculator_panel.py to slit_length_calculator_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\source_editor.py to source_editor.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\calculator\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\basepage.py to basepage.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\batchfitpage.py to batchfitpage.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\console.py to console.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\fitpage.py to fitpage.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\fitpanel.py to fitpanel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\fitproblem.py to fitproblem.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\fitting.py to fitting.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\fitting_widgets.py to fitting_widgets.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\fit_thread.py to fit_thread.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\ftol_dialog.py to ftol_dialog.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\help_panel.py to help_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\hint_fitpage.py to hint_fitpage.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\models.py to models.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\model_thread.py to model_thread.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\pagestate.py to pagestate.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\plugin_models\polynomial5.py to polynomial5.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\plugin_models\sph_bessel_jn.py to sph_bessel_jn.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\plugin_models\sum_Ap1_1_Ap2.py to sum_Ap1_1_Ap2.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\plugin_models\sum_p1_p2.py to sum_p1_p2.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\plugin_models\testmodel.py to testmodel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\plugin_models\testmodel_2.py to testmodel_2.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\plugin_models\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\report_dialog.py to report_dialog.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\resultpanel.py to resultpanel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\simfitpage.py to simfitpage.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\utils.py to utils.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\fitting\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\invariant\help_panel.py to help_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\invariant\invariant.py to invariant.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\invariant\invariant_details.py to invariant_details.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\invariant\invariant_panel.py to invariant_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\invariant\invariant_state.py to invariant_state.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\invariant\invariant_widgets.py to invariant_widgets.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\invariant\report_dialog.py to report_dialog.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\invariant\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\pr\explore_dialog.py to explore_dialog.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\pr\inversion_panel.py to inversion_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\pr\inversion_state.py to inversion_state.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\pr\pr.py to pr.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\pr\pr_thread.py to pr_thread.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\pr\pr_widgets.py to pr_widgets.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\pr\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\perspectives\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\arrow3d.py to arrow3d.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\BaseInteractor.py to BaseInteractor.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\binder.py to binder.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\canvas.py to canvas.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\config.py to config.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\fitDialog.py to fitDialog.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\fittings.py to fittings.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\LabelDialog.py to LabelDialog.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\LineModel.py to LineModel.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\PlotPanel.py to PlotPanel.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\plottables.py to plottables.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\plottable_interactor.py to plottable_interactor.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\PropertyDialog.py to PropertyDialog.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\SimpleFont.py to SimpleFont.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\SizeDialog.py to SizeDialog.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\TextDialog.py to TextDialog.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\toolbar.py to toolbar.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\transform.py to transform.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\unitConverter.py to unitConverter.pyc
+byte-compiling build\bdist.win32\egg\sans\plottools\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\pr\core\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\pr\distance_explorer.py to distance_explorer.pyc
+byte-compiling build\bdist.win32\egg\sans\pr\invertor.py to invertor.pyc
+byte-compiling build\bdist.win32\egg\sans\pr\num_term.py to num_term.pyc
+byte-compiling build\bdist.win32\egg\sans\pr\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\sansview\custom_config.py to custom_config.pyc
+byte-compiling build\bdist.win32\egg\sans\sansview\installer_generator.py to installer_generator.pyc
+byte-compiling build\bdist.win32\egg\sans\sansview\local_config.py to local_config.pyc
+byte-compiling build\bdist.win32\egg\sans\sansview\sansview.py to sansview.pyc
+byte-compiling build\bdist.win32\egg\sans\sansview\setup_exe.py to setup_exe.pyc
+byte-compiling build\bdist.win32\egg\sans\sansview\setup_mac.py to setup_mac.pyc
+byte-compiling build\bdist.win32\egg\sans\sansview\welcome_panel.py to welcome_panel.pyc
+byte-compiling build\bdist.win32\egg\sans\sansview\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sans\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\calculator\instrument.py to instrument.pyc
+byte-compiling build\bdist.win32\egg\sas\calculator\kiessig_calculator.py to kiessig_calculator.pyc
+byte-compiling build\bdist.win32\egg\sas\calculator\resolution_calculator.py to resolution_calculator.pyc
+byte-compiling build\bdist.win32\egg\sas\calculator\sas_gen.py to sas_gen.pyc
+byte-compiling build\bdist.win32\egg\sas\calculator\slit_length_calculator.py to slit_length_calculator.pyc
+byte-compiling build\bdist.win32\egg\sas\calculator\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\data_info.py to data_info.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\loader.py to loader.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\manipulations.py to manipulations.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\abs_reader.py to abs_reader.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\ascii_reader.py to ascii_reader.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\associations.py to associations.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\cansas_constants.py to cansas_constants.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\cansas_reader.py to cansas_reader.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\danse_reader.py to danse_reader.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\hfir1d_reader.py to hfir1d_reader.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\IgorReader.py to IgorReader.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\nexus_reader.py to nexus_reader.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\red2d_reader.py to red2d_reader.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\tiff_reader.py to tiff_reader.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\xml_reader.py to xml_reader.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\readers\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\dataloader\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\data_util\calcthread.py to calcthread.pyc
+byte-compiling build\bdist.win32\egg\sas\data_util\err1d.py to err1d.pyc
+byte-compiling build\bdist.win32\egg\sas\data_util\formatnum.py to formatnum.pyc
+byte-compiling build\bdist.win32\egg\sas\data_util\nxsunit.py to nxsunit.pyc
+byte-compiling build\bdist.win32\egg\sas\data_util\odict.py to odict.pyc
+byte-compiling build\bdist.win32\egg\sas\data_util\ordereddict.py to ordereddict.pyc
+byte-compiling build\bdist.win32\egg\sas\data_util\ordereddicttest.py to ordereddicttest.pyc
+byte-compiling build\bdist.win32\egg\sas\data_util\pathutils.py to pathutils.pyc
+byte-compiling build\bdist.win32\egg\sas\data_util\registry.py to registry.pyc
+byte-compiling build\bdist.win32\egg\sas\data_util\uncertainty.py to uncertainty.pyc
+byte-compiling build\bdist.win32\egg\sas\data_util\uniquelist.py to uniquelist.pyc
+byte-compiling build\bdist.win32\egg\sas\data_util\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\fit\AbstractFitEngine.py to AbstractFitEngine.pyc
+byte-compiling build\bdist.win32\egg\sas\fit\BumpsFitting.py to BumpsFitting.pyc
+byte-compiling build\bdist.win32\egg\sas\fit\expression.py to expression.pyc
+byte-compiling build\bdist.win32\egg\sas\fit\Fitting.py to Fitting.pyc
+byte-compiling build\bdist.win32\egg\sas\fit\Loader.py to Loader.pyc
+byte-compiling build\bdist.win32\egg\sas\fit\ParkFitting.py to ParkFitting.pyc
+byte-compiling build\bdist.win32\egg\sas\fit\ScipyFitting.py to ScipyFitting.pyc
+byte-compiling build\bdist.win32\egg\sas\fit\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\aboutbox.py to aboutbox.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\CategoryInstaller.py to CategoryInstaller.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\CategoryManager.py to CategoryManager.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\config.py to config.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\customdir.py to customdir.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\custom_pstats.py to custom_pstats.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\dataFitting.py to dataFitting.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\data_manager.py to data_manager.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\data_panel.py to data_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\data_processor.py to data_processor.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\data_state.py to data_state.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\documentation_window.py to documentation_window.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\dummyapp.py to dummyapp.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\events.py to events.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\gui_manager.py to gui_manager.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\gui_statusbar.py to gui_statusbar.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\gui_style.py to gui_style.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\gui_toolbar.py to gui_toolbar.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\data_loader\data_loader.py to data_loader.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\data_loader\help_panel.py to help_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\data_loader\load_thread.py to load_thread.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\data_loader\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\AnnulusSlicer.py to AnnulusSlicer.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\appearanceDialog.py to appearanceDialog.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\Arc.py to Arc.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\AzimutSlicer.py to AzimutSlicer.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\BaseInteractor.py to BaseInteractor.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\binder.py to binder.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\boxMask.py to boxMask.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\boxSlicer.py to boxSlicer.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\boxSum.py to boxSum.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\detector_dialog.py to detector_dialog.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\Edge.py to Edge.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\graphAppearance.py to graphAppearance.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\help_panel.py to help_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\masking.py to masking.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\Plotter1D.py to Plotter1D.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\Plotter2D.py to Plotter2D.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\plotting.py to plotting.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\profile_dialog.py to profile_dialog.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\sectorMask.py to sectorMask.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\SectorSlicer.py to SectorSlicer.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\SimplePlot.py to SimplePlot.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\slicerpanel.py to slicerpanel.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\SlicerParameters.py to SlicerParameters.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\plotting\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\local_perspectives\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\panel_base.py to panel_base.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\pdfview.py to pdfview.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\plugin_base.py to plugin_base.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\startup_configuration.py to startup_configuration.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\utils.py to utils.pyc
+byte-compiling build\bdist.win32\egg\sas\guiframe\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\invariant\invariant.py to invariant.pyc
+byte-compiling build\bdist.win32\egg\sas\invariant\invariant_mapper.py to invariant_mapper.pyc
+byte-compiling build\bdist.win32\egg\sas\invariant\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\models\AddComponent.py to AddComponent.pyc
+byte-compiling build\bdist.win32\egg\sas\models\BarBellModel.py to BarBellModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\BaseComponent.py to BaseComponent.pyc
+byte-compiling build\bdist.win32\egg\sas\models\BaseModel.py to BaseModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\BCCrystalModel.py to BCCrystalModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\BEPolyelectrolyte.py to BEPolyelectrolyte.pyc
+byte-compiling build\bdist.win32\egg\sas\models\BinaryHSModel.py to BinaryHSModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\BroadPeakModel.py to BroadPeakModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\CappedCylinderModel.py to CappedCylinderModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\Constant.py to Constant.pyc
+byte-compiling build\bdist.win32\egg\sas\models\Core2ndMomentModel.py to Core2ndMomentModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\CoreFourShellModel.py to CoreFourShellModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\CoreMultiShellModel.py to CoreMultiShellModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\CoreShellBicelleModel.py to CoreShellBicelleModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\CoreShellCylinderModel.py to CoreShellCylinderModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\CoreShellEllipsoidModel.py to CoreShellEllipsoidModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\CoreShellEllipsoidXTModel.py to CoreShellEllipsoidXTModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\CoreShellModel.py to CoreShellModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\CorrLengthModel.py to CorrLengthModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\Cos.py to Cos.pyc
+byte-compiling build\bdist.win32\egg\sas\models\CSParallelepipedModel.py to CSParallelepipedModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\CylinderModel.py to CylinderModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\DABModel.py to DABModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\DebyeModel.py to DebyeModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\DiamCylFunc.py to DiamCylFunc.pyc
+byte-compiling build\bdist.win32\egg\sas\models\DiamEllipFunc.py to DiamEllipFunc.pyc
+byte-compiling build\bdist.win32\egg\sas\models\DisperseModel.py to DisperseModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\dispersion_models.py to dispersion_models.pyc
+byte-compiling build\bdist.win32\egg\sas\models\DivComponent.py to DivComponent.pyc
+byte-compiling build\bdist.win32\egg\sas\models\EllipsoidModel.py to EllipsoidModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\EllipticalCylinderModel.py to EllipticalCylinderModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\FCCrystalModel.py to FCCrystalModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\FlexCylEllipXModel.py to FlexCylEllipXModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\FlexibleCylinderModel.py to FlexibleCylinderModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\FractalCoreShellModel.py to FractalCoreShellModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\FractalModel.py to FractalModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\FractalO_Z.py to FractalO_Z.pyc
+byte-compiling build\bdist.win32\egg\sas\models\FuzzySphereModel.py to FuzzySphereModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\Gaussian.py to Gaussian.pyc
+byte-compiling build\bdist.win32\egg\sas\models\GaussLorentzGelModel.py to GaussLorentzGelModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\GelFitModel.py to GelFitModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\GuinierModel.py to GuinierModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\GuinierPorodModel.py to GuinierPorodModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\HardsphereStructure.py to HardsphereStructure.pyc
+byte-compiling build\bdist.win32\egg\sas\models\HayterMSAStructure.py to HayterMSAStructure.pyc
+byte-compiling build\bdist.win32\egg\sas\models\HollowCylinderModel.py to HollowCylinderModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\LamellarFFHGModel.py to LamellarFFHGModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\LamellarModel.py to LamellarModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\LamellarPCrystalModel.py to LamellarPCrystalModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\LamellarPSHGModel.py to LamellarPSHGModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\LamellarPSModel.py to LamellarPSModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\LinearPearlsModel.py to LinearPearlsModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\LineModel.py to LineModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\LogNormal.py to LogNormal.pyc
+byte-compiling build\bdist.win32\egg\sas\models\Lorentzian.py to Lorentzian.pyc
+byte-compiling build\bdist.win32\egg\sas\models\LorentzModel.py to LorentzModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\MassFractalModel.py to MassFractalModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\MassSurfaceFractal.py to MassSurfaceFractal.pyc
+byte-compiling build\bdist.win32\egg\sas\models\MicelleSphCoreModel.py to MicelleSphCoreModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\ModelAdaptor.py to ModelAdaptor.pyc
+byte-compiling build\bdist.win32\egg\sas\models\MulComponent.py to MulComponent.pyc
+byte-compiling build\bdist.win32\egg\sas\models\MultiplicationModel.py to MultiplicationModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\MultiShellModel.py to MultiShellModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\NoStructure.py to NoStructure.pyc
+byte-compiling build\bdist.win32\egg\sas\models\NullModel.py to NullModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\OnionExpShellModel.py to OnionExpShellModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\OnionModel.py to OnionModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\ParallelepipedModel.py to ParallelepipedModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\PeakGaussModel.py to PeakGaussModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\PeakLorentzModel.py to PeakLorentzModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\PearlNecklaceModel.py to PearlNecklaceModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\pluginmodel.py to pluginmodel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\PolymerExclVolume.py to PolymerExclVolume.pyc
+byte-compiling build\bdist.win32\egg\sas\models\Poly_GaussCoil.py to Poly_GaussCoil.pyc
+byte-compiling build\bdist.win32\egg\sas\models\PorodModel.py to PorodModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\PowerLawAbsModel.py to PowerLawAbsModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\PowerLawModel.py to PowerLawModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\PringlesModel.py to PringlesModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\qsmearing.py to qsmearing.pyc
+byte-compiling build\bdist.win32\egg\sas\models\RaspBerryModel.py to RaspBerryModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\RectangularHollowPrismInfThinWallsModel.py to RectangularHollowPrismInfThinWallsModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\RectangularHollowPrismModel.py to RectangularHollowPrismModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\RectangularPrismModel.py to RectangularPrismModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\ReflAdvModel.py to ReflAdvModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\ReflectivityIIModel.py to ReflectivityIIModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\ReflectivityModel.py to ReflectivityModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\ReflModel.py to ReflModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\RPA10Model.py to RPA10Model.pyc
+byte-compiling build\bdist.win32\egg\sas\models\RPAModel.py to RPAModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\sas_extension\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\models\SCCrystalModel.py to SCCrystalModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\Schulz.py to Schulz.pyc
+byte-compiling build\bdist.win32\egg\sas\models\Sin.py to Sin.pyc
+byte-compiling build\bdist.win32\egg\sas\models\SLDCalFunc.py to SLDCalFunc.pyc
+byte-compiling build\bdist.win32\egg\sas\models\smearing_2d.py to smearing_2d.pyc
+byte-compiling build\bdist.win32\egg\sas\models\SphereModel.py to SphereModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\SphereSLDModel.py to SphereSLDModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\SphericalSLDModel.py to SphericalSLDModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\SquareWellStructure.py to SquareWellStructure.pyc
+byte-compiling build\bdist.win32\egg\sas\models\StackedDisksModel.py to StackedDisksModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\StarPolymer.py to StarPolymer.pyc
+byte-compiling build\bdist.win32\egg\sas\models\StickyHSStructure.py to StickyHSStructure.pyc
+byte-compiling build\bdist.win32\egg\sas\models\SubComponent.py to SubComponent.pyc
+byte-compiling build\bdist.win32\egg\sas\models\SurfaceFractalModel.py to SurfaceFractalModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\TeubnerStreyModel.py to TeubnerStreyModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\TriaxialEllipsoidModel.py to TriaxialEllipsoidModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\TwoLorentzianModel.py to TwoLorentzianModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\TwoPowerLawModel.py to TwoPowerLawModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\TwoYukawaModel.py to TwoYukawaModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\UnifiedPowerRgModel.py to UnifiedPowerRgModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\VesicleModel.py to VesicleModel.pyc
+byte-compiling build\bdist.win32\egg\sas\models\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\aperture_editor.py to aperture_editor.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\calculator.py to calculator.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\calculator_widgets.py to calculator_widgets.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\collimation_editor.py to collimation_editor.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\console.py to console.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\data_editor.py to data_editor.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\data_operator.py to data_operator.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\density_panel.py to density_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\detector_editor.py to detector_editor.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\gen_scatter_panel.py to gen_scatter_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\help_panel.py to help_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\image_viewer.py to image_viewer.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\kiessig_calculator_panel.py to kiessig_calculator_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\load_thread.py to load_thread.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\model_editor.py to model_editor.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\pyconsole.py to pyconsole.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\resolcal_thread.py to resolcal_thread.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\resolution_calculator_panel.py to resolution_calculator_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\sample_editor.py to sample_editor.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\sld_panel.py to sld_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\slit_length_calculator_panel.py to slit_length_calculator_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\source_editor.py to source_editor.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\calculator\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\basepage.py to basepage.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\batchfitpage.py to batchfitpage.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\console.py to console.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\fitpage.py to fitpage.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\fitpanel.py to fitpanel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\fitproblem.py to fitproblem.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\fitting.py to fitting.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\fitting_widgets.py to fitting_widgets.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\fit_thread.py to fit_thread.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\ftol_dialog.py to ftol_dialog.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\help_panel.py to help_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\hint_fitpage.py to hint_fitpage.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\models.py to models.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\model_thread.py to model_thread.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\pagestate.py to pagestate.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\plugin_models\polynomial5.py to polynomial5.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\plugin_models\sph_bessel_jn.py to sph_bessel_jn.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\plugin_models\sum_Ap1_1_Ap2.py to sum_Ap1_1_Ap2.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\plugin_models\sum_p1_p2.py to sum_p1_p2.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\plugin_models\testmodel.py to testmodel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\plugin_models\testmodel_2.py to testmodel_2.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\plugin_models\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\report_dialog.py to report_dialog.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\resultpanel.py to resultpanel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\simfitpage.py to simfitpage.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\utils.py to utils.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\fitting\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\invariant\help_panel.py to help_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\invariant\invariant.py to invariant.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\invariant\invariant_details.py to invariant_details.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\invariant\invariant_panel.py to invariant_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\invariant\invariant_state.py to invariant_state.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\invariant\invariant_widgets.py to invariant_widgets.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\invariant\report_dialog.py to report_dialog.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\invariant\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\pr\explore_dialog.py to explore_dialog.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\pr\inversion_panel.py to inversion_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\pr\inversion_state.py to inversion_state.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\pr\pr.py to pr.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\pr\pr_thread.py to pr_thread.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\pr\pr_widgets.py to pr_widgets.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\pr\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\perspectives\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\arrow3d.py to arrow3d.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\BaseInteractor.py to BaseInteractor.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\binder.py to binder.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\canvas.py to canvas.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\config.py to config.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\fitDialog.py to fitDialog.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\fittings.py to fittings.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\LabelDialog.py to LabelDialog.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\LineModel.py to LineModel.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\PlotPanel.py to PlotPanel.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\plottables.py to plottables.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\plottable_interactor.py to plottable_interactor.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\PropertyDialog.py to PropertyDialog.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\SimpleFont.py to SimpleFont.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\SizeDialog.py to SizeDialog.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\TextDialog.py to TextDialog.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\toolbar.py to toolbar.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\transform.py to transform.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\unitConverter.py to unitConverter.pyc
+byte-compiling build\bdist.win32\egg\sas\plottools\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\pr\core\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\pr\distance_explorer.py to distance_explorer.pyc
+byte-compiling build\bdist.win32\egg\sas\pr\invertor.py to invertor.pyc
+byte-compiling build\bdist.win32\egg\sas\pr\num_term.py to num_term.pyc
+byte-compiling build\bdist.win32\egg\sas\pr\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\sasview\custom_config.py to custom_config.pyc
+byte-compiling build\bdist.win32\egg\sas\sasview\installer_generator.py to installer_generator.pyc
+byte-compiling build\bdist.win32\egg\sas\sasview\local_config.py to local_config.pyc
+byte-compiling build\bdist.win32\egg\sas\sasview\sasview.py to sasview.pyc
+byte-compiling build\bdist.win32\egg\sas\sasview\setup_exe.py to setup_exe.pyc
+byte-compiling build\bdist.win32\egg\sas\sasview\setup_mac.py to setup_mac.pyc
+byte-compiling build\bdist.win32\egg\sas\sasview\welcome_panel.py to welcome_panel.pyc
+byte-compiling build\bdist.win32\egg\sas\sasview\__init__.py to __init__.pyc
+byte-compiling build\bdist.win32\egg\sas\__init__.py to __init__.pyc
+creating stub loader for sas\pr\core\pr_inversion.pyd
+creating stub loader for park\_modeling.pyd
+creating stub loader for sas\models\sas_extension\c_models.pyd
+creating stub loader for sas\models\sas_extension\smearer.pyd
+creating stub loader for sas\models\sas_extension\smearer2d_helper.pyd
+creating stub loader for sas\models\sas_extension\sld2i.pyd
+byte-compiling build\bdist.win32\egg\sas\pr\core\pr_inversion.py to pr_inversion.pyc
+byte-compiling build\bdist.win32\egg\park\_modeling.py to _modeling.pyc
+byte-compiling build\bdist.win32\egg\sas\models\sas_extension\c_models.py to c_models.pyc
+byte-compiling build\bdist.win32\egg\sas\models\sas_extension\smearer.py to smearer.pyc
+byte-compiling build\bdist.win32\egg\sas\models\sas_extension\smearer2d_helper.py to smearer2d_helper.pyc
+byte-compiling build\bdist.win32\egg\sas\models\sas_extension\sld2i.py to sld2i.pyc
+creating build\bdist.win32\egg\EGG-INFO
+copying sasview.egg-info\PKG-INFO -> build\bdist.win32\egg\EGG-INFO
+copying sasview.egg-info\SOURCES.txt -> build\bdist.win32\egg\EGG-INFO
+copying sasview.egg-info\dependency_links.txt -> build\bdist.win32\egg\EGG-INFO
+copying sasview.egg-info\entry_points.txt -> build\bdist.win32\egg\EGG-INFO
+copying sasview.egg-info\not-zip-safe -> build\bdist.win32\egg\EGG-INFO
+copying sasview.egg-info\requires.txt -> build\bdist.win32\egg\EGG-INFO
+copying sasview.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO
+writing build\bdist.win32\egg\EGG-INFO\native_libs.txt
+creating 'dist\sasview-3.0.0.post0-py2.7-win32.egg' and adding 'build\bdist.win32\egg' to it
+removing 'build\bdist.win32\egg' (and everything under it)
+Processing sasview-3.0.0.post0-py2.7-win32.egg
+removing 'c:\users\gonzalezm\appdata\roaming\python\python27\site-packages\sasview-3.0.0.post0-py2.7-win32.egg' (and everything under it)
+creating c:\users\gonzalezm\appdata\roaming\python\python27\site-packages\sasview-3.0.0.post0-py2.7-win32.egg
+Extracting sasview-3.0.0.post0-py2.7-win32.egg to c:\users\gonzalezm\appdata\roaming\python\python27\site-packages
+sasview 3.0.0.post0 is already the active version in easy-install.pth
+Installing sasview-script.py script to C:\Users\gonzalezm\AppData\Roaming\Python\Scripts
+Installing sasview.exe script to C:\Users\gonzalezm\AppData\Roaming\Python\Scripts
+Installing sasview.exe.manifest script to C:\Users\gonzalezm\AppData\Roaming\Python\Scripts
+
+Installed c:\users\gonzalezm\appdata\roaming\python\python27\site-packages\sasview-3.0.0.post0-py2.7-win32.egg
+Processing dependencies for sasview==3.0.0.post0
+Searching for reportlab==3.1.44
+Best match: reportlab 3.1.44
+Adding reportlab 3.1.44 to easy-install.pth file
+
+Using c:\users\gonzalezm\appdata\local\continuum\anaconda\lib\site-packages
+Searching for html5lib==1.0b3
+Best match: html5lib 1.0b3
+Processing html5lib-1.0b3-py2.7.egg
+html5lib 1.0b3 is already the active version in easy-install.pth
+
+Using c:\users\gonzalezm\appdata\local\continuum\anaconda\lib\site-packages\html5lib-1.0b3-py2.7.egg
+Searching for lxml==3.4.1
+Best match: lxml 3.4.1
+Adding lxml 3.4.1 to easy-install.pth file
+
+Using c:\users\gonzalezm\appdata\local\continuum\anaconda\lib\site-packages
+Searching for pyparsing==1.5.7
+Best match: pyparsing 1.5.7
+Processing pyparsing-1.5.7-py2.7-win32.egg
+pyparsing 1.5.7 is already the active version in easy-install.pth
+
+Using c:\users\gonzalezm\appdata\roaming\python\python27\site-packages\pyparsing-1.5.7-py2.7-win32.egg
+Searching for periodictable==1.4.1
+Best match: periodictable 1.4.1
+Processing periodictable-1.4.1-py2.7.egg
+periodictable 1.4.1 is already the active version in easy-install.pth
+
+Using c:\users\gonzalezm\appdata\roaming\python\python27\site-packages\periodictable-1.4.1-py2.7.egg
+Searching for bumps==0.7.5.4
+Best match: bumps 0.7.5.4
+Processing bumps-0.7.5.4-py2.7.egg
+bumps 0.7.5.4 is already the active version in easy-install.pth
+Installing bumps script to C:\Users\gonzalezm\AppData\Roaming\Python\Scripts
+
+Using c:\users\gonzalezm\appdata\roaming\python\python27\site-packages\bumps-0.7.5.4-py2.7.egg
+Searching for six==1.9.0
+Best match: six 1.9.0
+Adding six 1.9.0 to easy-install.pth file
+
+Using c:\users\gonzalezm\appdata\local\continuum\anaconda\lib\site-packages
+Searching for numpy==1.9.1
+Best match: numpy 1.9.1
+Adding numpy 1.9.1 to easy-install.pth file
+
+Using c:\users\gonzalezm\appdata\local\continuum\anaconda\lib\site-packages
+Finished processing dependencies for sasview==3.0.0.post0
Index: src/sans/models/BCCrystalModel.py
===================================================================
--- src/sans/models/BCCrystalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/BCCrystalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,213 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\bcc.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CBCCrystalModel
+
+def create_BCCrystalModel():
+    """
+       Create a model instance
+    """
+    obj = BCCrystalModel()
+    # CBCCrystalModel.__init__(obj) is called by
+    # the BCCrystalModel constructor
+    return obj
+
+class BCCrystalModel(CBCCrystalModel, BaseComponent):
+    """ 
+    Class that evaluates a BCCrystalModel model. 
+    This file was auto-generated from src\sans\models\include\bcc.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * dnn             = 220.0 [A]
+    * d_factor        = 0.06 
+    * radius          = 40.0 [A]
+    * sldSph          = 3e-06 [1/A^(2)]
+    * sldSolv         = 6.3e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * theta           = 0.0 [deg]
+    * phi             = 0.0 [deg]
+    * psi             = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CBCCrystalModel.__init__, (self,)) 
+
+        CBCCrystalModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "BCCrystalModel"
+        ## Model description
+        self.description = """
+        P(q)=(scale/Vp)*V_lattice*P(q)*Z(q)+bkg where scale is the volume
+		fraction of sphere,
+		Vp = volume of the primary particle,
+		V_lattice = volume correction for
+		for the crystal structure,
+		P(q)= form factor of the sphere (normalized),
+		Z(q)= paracrystalline structure factor
+		for a face centered cubic structure.
+		[Body Centered Cubic ParaCrystal Model]
+		Parameters;
+		scale: volume fraction of spheres
+		bkg:background, R: radius of sphere
+		dnn: Nearest neighbor distance
+		d_factor: Paracrystal distortion factor
+		radius: radius of the spheres
+		sldSph: SLD of the sphere
+		sldSolv: SLD of the solvent
+		
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['dnn'] = ['[A]', None, None]
+        self.details['d_factor'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['sldSph'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['theta'] = ['[deg]', None, None]
+        self.details['phi'] = ['[deg]', None, None]
+        self.details['psi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius.width',
+                      'phi.width',
+                      'psi.width',
+                      'theta.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['phi',
+                                   'psi',
+                                   'theta',
+                                   'phi.width',
+                                   'psi.width',
+                                   'theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_BCCrystalModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(BCCrystalModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CBCCrystalModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CBCCrystalModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CBCCrystalModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CBCCrystalModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CBCCrystalModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CBCCrystalModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/BarBellModel.py
===================================================================
--- src/sans/models/BarBellModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/BarBellModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,210 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\barbell.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CBarBellModel
+
+def create_BarBellModel():
+    """
+       Create a model instance
+    """
+    obj = BarBellModel()
+    # CBarBellModel.__init__(obj) is called by
+    # the BarBellModel constructor
+    return obj
+
+class BarBellModel(CBarBellModel, BaseComponent):
+    """ 
+    Class that evaluates a BarBellModel model. 
+    This file was auto-generated from src\sans\models\include\barbell.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * rad_bar         = 20.0 [A]
+    * len_bar         = 400.0 [A]
+    * rad_bell        = 40.0 [A]
+    * sld_barbell     = 1e-06 [1/A^(2)]
+    * sld_solv        = 6.3e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * theta           = 0.0 [deg]
+    * phi             = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CBarBellModel.__init__, (self,)) 
+
+        CBarBellModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "BarBellModel"
+        ## Model description
+        self.description = """
+        Calculates the scattering from a barbell-shaped cylinder. That is
+		a sphereocylinder with spherical end caps
+		that have a radius larger than that of
+		the cylinder and the center of the end cap
+		radius lies outside of the cylinder.
+		Note: As the length of cylinder(bar) -->0,
+		it becomes a dumbbell.
+		And when rad_bar = rad_bell,
+		it is a spherocylinder.
+		It must be that rad_bar <(=) rad_bell.
+		[Parameters];
+		scale: volume fraction of spheres,
+		background:incoherent background,
+		rad_bar: radius of the cylindrical bar,
+		len_bar: length of the cylindrical bar,
+		rad_bell: radius of the spherical bell,
+		sld_barbell: SLD of the barbell,
+		sld_solv: SLD of the solvent.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['rad_bar'] = ['[A]', None, None]
+        self.details['len_bar'] = ['[A]', None, None]
+        self.details['rad_bell'] = ['[A]', None, None]
+        self.details['sld_barbell'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['theta'] = ['[deg]', None, None]
+        self.details['phi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['rad_bar.width',
+                      'len_bar',
+                      'rad_bell',
+                      'phi.width',
+                      'theta.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['phi',
+                                   'theta',
+                                   'phi.width',
+                                   'theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_BarBellModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(BarBellModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CBarBellModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CBarBellModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CBarBellModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CBarBellModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CBarBellModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CBarBellModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/BinaryHSModel.py
===================================================================
--- src/sans/models/BinaryHSModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/BinaryHSModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,192 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\binaryHS.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CBinaryHSModel
+
+def create_BinaryHSModel():
+    """
+       Create a model instance
+    """
+    obj = BinaryHSModel()
+    # CBinaryHSModel.__init__(obj) is called by
+    # the BinaryHSModel constructor
+    return obj
+
+class BinaryHSModel(CBinaryHSModel, BaseComponent):
+    """ 
+    Class that evaluates a BinaryHSModel model. 
+    This file was auto-generated from src\sans\models\include\binaryHS.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * l_radius        = 100.0 [A]
+    * s_radius        = 25.0 [A]
+    * vol_frac_ls     = 0.1 
+    * vol_frac_ss     = 0.2 
+    * ls_sld          = 3.5e-06 [1/A^(2)]
+    * ss_sld          = 5e-07 [1/A^(2)]
+    * solvent_sld     = 6.36e-06 [1/A^(2)]
+    * background      = 0.001 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CBinaryHSModel.__init__, (self,)) 
+
+        CBinaryHSModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "BinaryHSModel"
+        ## Model description
+        self.description = """
+         Model parameters: l_radius : large radius of binary hard sphere
+		s_radius : small radius of binary hard sphere
+		vol_frac_ls : volume fraction of large spheres
+		vol_frac_ss : volume fraction of small spheres
+		ls_sld: large sphere  scattering length density
+		ss_sld: small sphere scattering length density
+		solvent_sld: solvent scattering length density
+		background: incoherent background
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['l_radius'] = ['[A]', None, None]
+        self.details['s_radius'] = ['[A]', None, None]
+        self.details['vol_frac_ls'] = ['', None, None]
+        self.details['vol_frac_ss'] = ['', None, None]
+        self.details['ls_sld'] = ['[1/A^(2)]', None, None]
+        self.details['ss_sld'] = ['[1/A^(2)]', None, None]
+        self.details['solvent_sld'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['l_radius.width',
+                      's_radius.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_BinaryHSModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(BinaryHSModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CBinaryHSModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CBinaryHSModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CBinaryHSModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CBinaryHSModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CBinaryHSModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CBinaryHSModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/CSParallelepipedModel.py
===================================================================
--- src/sans/models/CSParallelepipedModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/CSParallelepipedModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,223 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\csparallelepiped.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CCSParallelepipedModel
+
+def create_CSParallelepipedModel():
+    """
+       Create a model instance
+    """
+    obj = CSParallelepipedModel()
+    # CCSParallelepipedModel.__init__(obj) is called by
+    # the CSParallelepipedModel constructor
+    return obj
+
+class CSParallelepipedModel(CCSParallelepipedModel, BaseComponent):
+    """ 
+    Class that evaluates a CSParallelepipedModel model. 
+    This file was auto-generated from src\sans\models\include\csparallelepiped.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * shortA          = 35.0 [A]
+    * midB            = 75.0 [A]
+    * longC           = 400.0 [A]
+    * rimA            = 10.0 [A]
+    * rimB            = 10.0 [A]
+    * rimC            = 10.0 [A]
+    * sld_rimA        = 2e-06 [1/A^(2)]
+    * sld_rimB        = 4e-06 [1/A^(2)]
+    * sld_rimC        = 2e-06 [1/A^(2)]
+    * sld_pcore       = 1e-06 [1/A^(2)]
+    * sld_solv        = 6e-06 [1/A^(2)]
+    * background      = 0.06 [1/cm]
+    * parallel_theta  = 0.0 [deg]
+    * parallel_phi    = 0.0 [deg]
+    * parallel_psi    = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CCSParallelepipedModel.__init__, (self,)) 
+
+        CCSParallelepipedModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "CSParallelepipedModel"
+        ## Model description
+        self.description = """
+         Form factor for a rectangular Shell. Below are the Parameters.
+		scale: scale factor
+		shortA: length of short edge  [A]
+		midB: length of another short edge [A]
+		longC: length of long edge  of the parallelepiped [A]
+		rimA: length of short edge  [A]
+		rimB: length of another short edge [A]
+		rimC: length of long edge  of the parallelepiped [A]
+		sld_rimA: sld of rimA [1/A^(2)]
+		sld_rimB: sld of rimB [1/A^(2)]
+		sld_rimC: sld of rimC [1/A^(2)]
+		sld_core: Pipe_sld [1/A^(2)]
+		sld_solv: solvent_sld [1/A^(2)]
+		background: incoherent Background [1/cm]
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['shortA'] = ['[A]', None, None]
+        self.details['midB'] = ['[A]', None, None]
+        self.details['longC'] = ['[A]', None, None]
+        self.details['rimA'] = ['[A]', None, None]
+        self.details['rimB'] = ['[A]', None, None]
+        self.details['rimC'] = ['[A]', None, None]
+        self.details['sld_rimA'] = ['[1/A^(2)]', None, None]
+        self.details['sld_rimB'] = ['[1/A^(2)]', None, None]
+        self.details['sld_rimC'] = ['[1/A^(2)]', None, None]
+        self.details['sld_pcore'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['parallel_theta'] = ['[deg]', None, None]
+        self.details['parallel_phi'] = ['[deg]', None, None]
+        self.details['parallel_psi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['shortA.width',
+                      'midB.width',
+                      'longC.width',
+                      'parallel_phi.width',
+                      'parallel_psi.width',
+                      'parallel_theta.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['parallel_phi',
+                                   'parallel_psi',
+                                   'parallel_theta',
+                                   'parallel_phi.width',
+                                   'parallel_psi.width',
+                                   'parallel_theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_CSParallelepipedModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(CSParallelepipedModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCSParallelepipedModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCSParallelepipedModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CCSParallelepipedModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CCSParallelepipedModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CCSParallelepipedModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CCSParallelepipedModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/CappedCylinderModel.py
===================================================================
--- src/sans/models/CappedCylinderModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/CappedCylinderModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,208 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\capcyl.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CCappedCylinderModel
+
+def create_CappedCylinderModel():
+    """
+       Create a model instance
+    """
+    obj = CappedCylinderModel()
+    # CCappedCylinderModel.__init__(obj) is called by
+    # the CappedCylinderModel constructor
+    return obj
+
+class CappedCylinderModel(CCappedCylinderModel, BaseComponent):
+    """ 
+    Class that evaluates a CappedCylinderModel model. 
+    This file was auto-generated from src\sans\models\include\capcyl.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * rad_cyl         = 20.0 [A]
+    * len_cyl         = 400.0 [A]
+    * rad_cap         = 40.0 [A]
+    * sld_capcyl      = 1e-06 [1/A^(2)]
+    * sld_solv        = 6.3e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * theta           = 0.0 [deg]
+    * phi             = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CCappedCylinderModel.__init__, (self,)) 
+
+        CCappedCylinderModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "CappedCylinderModel"
+        ## Model description
+        self.description = """
+        Calculates the scattering from a cylinder with spherical section end-caps.
+		That is, a sphereocylinder
+		with end caps that have a radius larger than
+		that of the cylinder and the center of the
+		end cap radius lies within the cylinder.
+		Note: As the length of cylinder -->0,
+		it becomes a ConvexLens.
+		It must be that rad_cyl <(=) rad_cap.
+		[Parameters];
+		scale: volume fraction of spheres,
+		background:incoherent background,
+		rad_cyl: radius of the cylinder,
+		len_cyl: length of the cylinder,
+		rad_cap: radius of the semi-spherical cap,
+		sld_capcyl: SLD of the capped cylinder,
+		sld_solv: SLD of the solvent.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['rad_cyl'] = ['[A]', None, None]
+        self.details['len_cyl'] = ['[A]', None, None]
+        self.details['rad_cap'] = ['[A]', None, None]
+        self.details['sld_capcyl'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['theta'] = ['[deg]', None, None]
+        self.details['phi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['rad_cyl.width',
+                      'len_cyl',
+                      'rad_cap',
+                      'phi.width',
+                      'theta.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['phi',
+                                   'theta',
+                                   'phi.width',
+                                   'theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_CappedCylinderModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(CappedCylinderModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCappedCylinderModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCappedCylinderModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CCappedCylinderModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CCappedCylinderModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CCappedCylinderModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CCappedCylinderModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/Core2ndMomentModel.py
===================================================================
--- src/sans/models/Core2ndMomentModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/Core2ndMomentModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,196 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\coresecondmoment.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CCore2ndMomentModel
+
+def create_Core2ndMomentModel():
+    """
+       Create a model instance
+    """
+    obj = Core2ndMomentModel()
+    # CCore2ndMomentModel.__init__(obj) is called by
+    # the Core2ndMomentModel constructor
+    return obj
+
+class Core2ndMomentModel(CCore2ndMomentModel, BaseComponent):
+    """ 
+    Class that evaluates a Core2ndMomentModel model. 
+    This file was auto-generated from src\sans\models\include\coresecondmoment.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * density_poly    = 0.7 [g/cm^(3)]
+    * sld_poly        = 1.5e-06 [1/A^(2)]
+    * radius_core     = 500.0 [A]
+    * volf_cores      = 0.14 
+    * ads_amount      = 1.9 [mg/m^(2)]
+    * sld_solv        = 6.3e-06 [1/A^(2)]
+    * second_moment   = 23.0 [A]
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CCore2ndMomentModel.__init__, (self,)) 
+
+        CCore2ndMomentModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "Core2ndMomentModel"
+        ## Model description
+        self.description = """
+        Calculate CoreSecondMoment Model
+		
+		scale:calibration factor,
+		density_poly: density of the layer
+		sld_poly: the SLD of the layer
+		volf_cores: volume fraction of cores
+		ads_amount: adsorbed amount
+		second_moment: second moment of the layer
+		sld_solv: the SLD of the solvent
+		background
+		
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['density_poly'] = ['[g/cm^(3)]', None, None]
+        self.details['sld_poly'] = ['[1/A^(2)]', None, None]
+        self.details['radius_core'] = ['[A]', None, None]
+        self.details['volf_cores'] = ['', None, None]
+        self.details['ads_amount'] = ['[mg/m^(2)]', None, None]
+        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['second_moment'] = ['[A]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius_core.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_Core2ndMomentModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(Core2ndMomentModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCore2ndMomentModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCore2ndMomentModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CCore2ndMomentModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CCore2ndMomentModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CCore2ndMomentModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CCore2ndMomentModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/CoreFourShellModel.py
===================================================================
--- src/sans/models/CoreFourShellModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/CoreFourShellModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,267 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\corefourshell.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CCoreFourShellModel
+
+def create_CoreFourShellModel():
+    """
+       Create a model instance
+    """
+    obj = CoreFourShellModel()
+    # CCoreFourShellModel.__init__(obj) is called by
+    # the CoreFourShellModel constructor
+    return obj
+
+class CoreFourShellModel(CCoreFourShellModel, BaseComponent):
+    """ 
+    Class that evaluates a CoreFourShellModel model. 
+    This file was auto-generated from src\sans\models\include\corefourshell.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * rad_core0       = 60.0 [A]
+    * sld_core0       = 6.4e-06 [1/A^(2)]
+    * thick_shell1    = 10.0 [A]
+    * sld_shell1      = 1e-06 [1/A^(2)]
+    * thick_shell2    = 10.0 [A]
+    * sld_shell2      = 2e-06 [1/A^(2)]
+    * thick_shell3    = 10.0 [A]
+    * sld_shell3      = 3e-06 [1/A^(2)]
+    * thick_shell4    = 10.0 [A]
+    * sld_shell4      = 4e-06 [1/A^(2)]
+    * sld_solv        = 6.4e-06 [1/A^(2)]
+    * background      = 0.001 [1/cm]
+    * M0_sld_shell1   = 0.0 [1/A^(2)]
+    * M_theta_shell1  = 0.0 [deg]
+    * M_phi_shell1    = 0.0 [deg]
+    * M0_sld_shell2   = 0.0 [1/A^(2)]
+    * M_theta_shell2  = 0.0 [deg]
+    * M_phi_shell2    = 0.0 [deg]
+    * M0_sld_shell3   = 0.0 [1/A^(2)]
+    * M_theta_shell3  = 0.0 [deg]
+    * M_phi_shell3    = 0.0 [deg]
+    * M0_sld_shell4   = 0.0 [1/A^(2)]
+    * M_theta_shell4  = 0.0 [deg]
+    * M_phi_shell4    = 0.0 [deg]
+    * M0_sld_core0    = 0.0 [1/A^(2)]
+    * M_theta_core0   = 0.0 [deg]
+    * M_phi_core0     = 0.0 [deg]
+    * M0_sld_solv     = 0.0 [1/A^(2)]
+    * M_theta_solv    = 0.0 [deg]
+    * M_phi_solv      = 0.0 [deg]
+    * Up_frac_i       = 0.5 [u/(u+d)]
+    * Up_frac_f       = 0.5 [u/(u+d)]
+    * Up_theta        = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CCoreFourShellModel.__init__, (self,)) 
+
+        CCoreFourShellModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "CoreFourShellModel"
+        ## Model description
+        self.description = """
+         Calculates the scattering intensity from a core-4 shell structure.
+		scale = scale factor * volume fraction
+		rad_core0: the radius of the core
+		sld_core0: the SLD of the core
+		thick_shelli: the thickness of the i'th shell from the core
+		sld_shelli: the SLD of the i'th shell from the core
+		sld_solv: the SLD of the solvent
+		background: incoherent background
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['rad_core0'] = ['[A]', None, None]
+        self.details['sld_core0'] = ['[1/A^(2)]', None, None]
+        self.details['thick_shell1'] = ['[A]', None, None]
+        self.details['sld_shell1'] = ['[1/A^(2)]', None, None]
+        self.details['thick_shell2'] = ['[A]', None, None]
+        self.details['sld_shell2'] = ['[1/A^(2)]', None, None]
+        self.details['thick_shell3'] = ['[A]', None, None]
+        self.details['sld_shell3'] = ['[1/A^(2)]', None, None]
+        self.details['thick_shell4'] = ['[A]', None, None]
+        self.details['sld_shell4'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['M0_sld_shell1'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_shell1'] = ['[deg]', None, None]
+        self.details['M_phi_shell1'] = ['[deg]', None, None]
+        self.details['M0_sld_shell2'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_shell2'] = ['[deg]', None, None]
+        self.details['M_phi_shell2'] = ['[deg]', None, None]
+        self.details['M0_sld_shell3'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_shell3'] = ['[deg]', None, None]
+        self.details['M_phi_shell3'] = ['[deg]', None, None]
+        self.details['M0_sld_shell4'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_shell4'] = ['[deg]', None, None]
+        self.details['M_phi_shell4'] = ['[deg]', None, None]
+        self.details['M0_sld_core0'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_core0'] = ['[deg]', None, None]
+        self.details['M_phi_core0'] = ['[deg]', None, None]
+        self.details['M0_sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_solv'] = ['[deg]', None, None]
+        self.details['M_phi_solv'] = ['[deg]', None, None]
+        self.details['Up_frac_i'] = ['[u/(u+d)]', None, None]
+        self.details['Up_frac_f'] = ['[u/(u+d)]', None, None]
+        self.details['Up_theta'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['thick_shell4.width',
+                      'thick_shell1.width',
+                      'thick_shell2.width',
+                      'thick_shell3.width',
+                      'rad_core0.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['M0_sld_shell4',
+                                   'M_theta_shell4',
+                                   'M_phi_shell4',
+                                   'M0_sld_shell3',
+                                   'M_theta_shell3',
+                                   'M_phi_shell3',
+                                   'M0_sld_shell2',
+                                   'M_theta_shell2',
+                                   'M_phi_shell2',
+                                   'M0_sld_shell1',
+                                   'M_theta_shell1',
+                                   'M_phi_shell1',
+                                   'M0_sld_core0',
+                                   'M_theta_core0',
+                                   'M_phi_core0',
+                                   'M0_sld_solv',
+                                   'M_theta_solv',
+                                   'M_phi_solv',
+                                   'Up_frac_i',
+                                   'Up_frac_f',
+                                   'Up_theta']
+
+        ## parameters with magnetism
+        self.magnetic_params = ['M0_sld_shell4', 'M_theta_shell4', 'M_phi_shell4', 'M0_sld_shell3', 'M_theta_shell3', 'M_phi_shell3', 'M0_sld_shell2', 'M_theta_shell2', 'M_phi_shell2', 'M0_sld_shell1', 'M_theta_shell1', 'M_phi_shell1', 'M0_sld_core0', 'M_theta_core0', 'M_phi_core0', 'M0_sld_solv', 'M_theta_solv', 'M_phi_solv', 'Up_frac_i', 'Up_frac_f', 'Up_theta']
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_CoreFourShellModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(CoreFourShellModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCoreFourShellModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCoreFourShellModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CCoreFourShellModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CCoreFourShellModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CCoreFourShellModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CCoreFourShellModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/CoreShellBicelleModel.py
===================================================================
--- src/sans/models/CoreShellBicelleModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/CoreShellBicelleModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,223 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\core_shell_bicelle.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CCoreShellBicelleModel
+
+def create_CoreShellBicelleModel():
+    """
+       Create a model instance
+    """
+    obj = CoreShellBicelleModel()
+    # CCoreShellBicelleModel.__init__(obj) is called by
+    # the CoreShellBicelleModel constructor
+    return obj
+
+class CoreShellBicelleModel(CCoreShellBicelleModel, BaseComponent):
+    """ 
+    Class that evaluates a CoreShellBicelleModel model. 
+    This file was auto-generated from src\sans\models\include\core_shell_bicelle.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * radius          = 20.0 [A]
+    * scale           = 1.0 
+    * rim_thick       = 10.0 [A]
+    * face_thick      = 10.0 [A]
+    * length          = 400.0 [A]
+    * core_sld        = 1e-06 [1/A^(2)]
+    * face_sld        = 4e-06 [1/A^(2)]
+    * rim_sld         = 4e-06 [1/A^(2)]
+    * solvent_sld     = 1e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * axis_theta      = 90.0 [deg]
+    * axis_phi        = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CCoreShellBicelleModel.__init__, (self,)) 
+
+        CCoreShellBicelleModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "CoreShellBicelleModel"
+        ## Model description
+        self.description = """
+        P(q,alpha)= scale/Vs*f(q)^(2) + bkg,  where: f(q)= 2(core_sld
+		- solvant_sld)* Vc*sin[qLcos(alpha/2)]
+		/[qLcos(alpha/2)]*J1(qRsin(alpha))
+		/[qRsin(alpha)]+2(shell_sld-solvent_sld)
+		*Vs*sin[q(L+T)cos(alpha/2)][[q(L+T)
+		*cos(alpha/2)]*J1(q(R+T)sin(alpha))
+		/q(R+T)sin(alpha)]
+		
+		alpha:is the angle between the axis of
+		the cylinder and the q-vector
+		Vs: the volume of the outer shell
+		Vc: the volume of the core
+		L: the length of the core
+		shell_sld: the scattering length density
+		of the shell
+		solvent_sld: the scattering length density
+		of the solvent
+		bkg: the background
+		T: the thickness
+		R+T: is the outer radius
+		L+2T: The total length of the outershell
+		J1: the first order Bessel function
+		theta: axis_theta of the cylinder
+		phi: the axis_phi of the cylinder...
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['radius'] = ['[A]', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['rim_thick'] = ['[A]', None, None]
+        self.details['face_thick'] = ['[A]', None, None]
+        self.details['length'] = ['[A]', None, None]
+        self.details['core_sld'] = ['[1/A^(2)]', None, None]
+        self.details['face_sld'] = ['[1/A^(2)]', None, None]
+        self.details['rim_sld'] = ['[1/A^(2)]', None, None]
+        self.details['solvent_sld'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['axis_theta'] = ['[deg]', None, None]
+        self.details['axis_phi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['axis_phi.width',
+                      'axis_theta.width',
+                      'length.width',
+                      'radius.width',
+                      'rim_thick.width',
+                      'face_thick.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['axis_phi',
+                                   'axis_theta',
+                                   'axis_phi.width',
+                                   'axis_theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_CoreShellBicelleModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(CoreShellBicelleModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCoreShellBicelleModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCoreShellBicelleModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CCoreShellBicelleModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CCoreShellBicelleModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CCoreShellBicelleModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CCoreShellBicelleModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/CoreShellCylinderModel.py
===================================================================
--- src/sans/models/CoreShellCylinderModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/CoreShellCylinderModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,219 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\core_shell_cylinder.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CCoreShellCylinderModel
+
+def create_CoreShellCylinderModel():
+    """
+       Create a model instance
+    """
+    obj = CoreShellCylinderModel()
+    # CCoreShellCylinderModel.__init__(obj) is called by
+    # the CoreShellCylinderModel constructor
+    return obj
+
+class CoreShellCylinderModel(CCoreShellCylinderModel, BaseComponent):
+    """ 
+    Class that evaluates a CoreShellCylinderModel model. 
+    This file was auto-generated from src\sans\models\include\core_shell_cylinder.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * radius          = 20.0 [A]
+    * scale           = 1.0 
+    * thickness       = 10.0 [A]
+    * length          = 400.0 [A]
+    * core_sld        = 1e-06 [1/A^(2)]
+    * shell_sld       = 4e-06 [1/A^(2)]
+    * solvent_sld     = 1e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * axis_theta      = 90.0 [deg]
+    * axis_phi        = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CCoreShellCylinderModel.__init__, (self,)) 
+
+        CCoreShellCylinderModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "CoreShellCylinderModel"
+        ## Model description
+        self.description = """
+        P(q,alpha)= scale/Vs*f(q)^(2) + bkg,
+		where: f(q)= 2(core_sld
+		- solvant_sld)* Vc*sin[qLcos(alpha/2)]
+		/[qLcos(alpha/2)]*J1(qRsin(alpha))
+		/[qRsin(alpha)]+2(shell_sld-solvent_sld)
+		*Vs*sin[q(L+T)cos(alpha/2)][[q(L+T)
+		*cos(alpha/2)]*J1(q(R+T)sin(alpha))
+		/q(R+T)sin(alpha)]
+		
+		alpha:is the angle between the axis of
+		the cylinder and the q-vector
+		Vs: the volume of the outer shell
+		Vc: the volume of the core
+		L: the length of the core
+		shell_sld: the scattering length density
+		of the shell
+		solvent_sld: the scattering length density
+		of the solvent
+		bkg: the background
+		T: the thickness
+		R+T: is the outer radius
+		L+2T: The total length of the outershell
+		J1: the first order Bessel function
+		theta: axis_theta of the cylinder
+		phi: the axis_phi of the cylinder...
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['radius'] = ['[A]', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['thickness'] = ['[A]', None, None]
+        self.details['length'] = ['[A]', None, None]
+        self.details['core_sld'] = ['[1/A^(2)]', None, None]
+        self.details['shell_sld'] = ['[1/A^(2)]', None, None]
+        self.details['solvent_sld'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['axis_theta'] = ['[deg]', None, None]
+        self.details['axis_phi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['axis_phi.width',
+                      'axis_theta.width',
+                      'length.width',
+                      'radius.width',
+                      'thickness.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['axis_phi',
+                                   'axis_theta',
+                                   'axis_phi.width',
+                                   'axis_theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_CoreShellCylinderModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(CoreShellCylinderModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCoreShellCylinderModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCoreShellCylinderModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CCoreShellCylinderModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CCoreShellCylinderModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CCoreShellCylinderModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CCoreShellCylinderModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/CoreShellEllipsoidModel.py
===================================================================
--- src/sans/models/CoreShellEllipsoidModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/CoreShellEllipsoidModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,217 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\spheroid.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CCoreShellEllipsoidModel
+
+def create_CoreShellEllipsoidModel():
+    """
+       Create a model instance
+    """
+    obj = CoreShellEllipsoidModel()
+    # CCoreShellEllipsoidModel.__init__(obj) is called by
+    # the CoreShellEllipsoidModel constructor
+    return obj
+
+class CoreShellEllipsoidModel(CCoreShellEllipsoidModel, BaseComponent):
+    """ 
+    Class that evaluates a CoreShellEllipsoidModel model. 
+    This file was auto-generated from src\sans\models\include\spheroid.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * equat_core      = 200.0 [A]
+    * polar_core      = 20.0 [A]
+    * equat_shell     = 250.0 [A]
+    * polar_shell     = 30.0 [A]
+    * sld_core        = 2e-06 [1/A^(2)]
+    * sld_shell       = 1e-06 [1/A^(2)]
+    * sld_solvent     = 6.3e-06 [1/A^(2)]
+    * background      = 0.001 [1/cm]
+    * axis_theta      = 0.0 [deg]
+    * axis_phi        = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CCoreShellEllipsoidModel.__init__, (self,)) 
+
+        CCoreShellEllipsoidModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "CoreShellEllipsoidModel"
+        ## Model description
+        self.description = """
+        [SpheroidCoreShellModel] Calculates the form factor for an spheroid
+		ellipsoid particle with a core_shell structure.
+		The form factor is averaged over all possible
+		orientations of the ellipsoid such that P(q)
+		= scale*<f^2>/Vol + bkg, where f is the
+		single particle scattering amplitude.
+		[Parameters]:
+		equat_core = equatorial radius of core,
+		polar_core = polar radius of core,
+		equat_shell = equatorial radius of shell,
+		polar_shell = polar radius (revolution axis) of shell,
+		sld_core = SLD_core
+		sld_shell = SLD_shell
+		sld_solvent = SLD_solvent
+		background = Incoherent bkg
+		scale =scale
+		Note:It is the users' responsibility to ensure
+		that shell radii are larger than core radii.
+		oblate: polar radius < equatorial radius
+		prolate :  polar radius > equatorial radius
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['equat_core'] = ['[A]', None, None]
+        self.details['polar_core'] = ['[A]', None, None]
+        self.details['equat_shell'] = ['[A]', None, None]
+        self.details['polar_shell'] = ['[A]', None, None]
+        self.details['sld_core'] = ['[1/A^(2)]', None, None]
+        self.details['sld_shell'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solvent'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['axis_theta'] = ['[deg]', None, None]
+        self.details['axis_phi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['equat_core.width',
+                      'polar_core.width',
+                      'equat_shell.width',
+                      'polar_shell.width',
+                      'axis_phi.width',
+                      'axis_theta.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['axis_phi',
+                                   'axis_theta',
+                                   'axis_phi.width',
+                                   'axis_theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_CoreShellEllipsoidModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(CoreShellEllipsoidModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCoreShellEllipsoidModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCoreShellEllipsoidModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CCoreShellEllipsoidModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CCoreShellEllipsoidModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CCoreShellEllipsoidModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CCoreShellEllipsoidModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/CoreShellEllipsoidXTModel.py
===================================================================
--- src/sans/models/CoreShellEllipsoidXTModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/CoreShellEllipsoidXTModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,218 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\spheroidXT.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CCoreShellEllipsoidXTModel
+
+def create_CoreShellEllipsoidXTModel():
+    """
+       Create a model instance
+    """
+    obj = CoreShellEllipsoidXTModel()
+    # CCoreShellEllipsoidXTModel.__init__(obj) is called by
+    # the CoreShellEllipsoidXTModel constructor
+    return obj
+
+class CoreShellEllipsoidXTModel(CCoreShellEllipsoidXTModel, BaseComponent):
+    """ 
+    Class that evaluates a CoreShellEllipsoidXTModel model. 
+    This file was auto-generated from src\sans\models\include\spheroidXT.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 0.05 
+    * equat_core      = 20.0 [A]
+    * X_core          = 3.0 
+    * T_shell         = 30.0 [A]
+    * XpolarShell     = 1.0 
+    * sld_core        = 2e-06 [1/A^(2)]
+    * sld_shell       = 1e-06 [1/A^(2)]
+    * sld_solvent     = 6.3e-06 [1/A^(2)]
+    * background      = 0.001 [1/cm]
+    * axis_theta      = 0.0 [deg]
+    * axis_phi        = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CCoreShellEllipsoidXTModel.__init__, (self,)) 
+
+        CCoreShellEllipsoidXTModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "CoreShellEllipsoidXTModel"
+        ## Model description
+        self.description = """
+        [SpheroidCoreShellModel] Calculates the form factor for an spheroid
+		ellipsoid particle with a core_shell structure.
+		The form factor is averaged over all possible
+		orientations of the ellipsoid such that P(q)
+		= scale*<f^2>/Vol + bkg, where f is the
+		single particle scattering amplitude.
+		[Parameters]:
+		equat_core = equatorial radius of core,
+		polar_core = polar radius of core = equat_core*X_core,
+		equat_shell = equatorial radius of outer surface = equat_core + T_shell,
+		polar_shell = polar radius (revolution axis) of outer surface =  equat_core*X_core + XpolarShell*T_shell
+		sld_core = SLD_core
+		sld_shell = SLD_shell
+		sld_solvent = SLD_solvent
+		background = Incoherent bkg
+		scale =scale
+		Note:It is the users' responsibility to ensure
+		that shell radii are larger than core radii.
+		oblate: polar radius < equatorial radius
+		prolate :  polar radius > equatorial radius - this new model will make this easier
+		and polydispersity integrals more logical (as previously the shell could disappear).
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['equat_core'] = ['[A]', None, None]
+        self.details['X_core'] = ['', None, None]
+        self.details['T_shell'] = ['[A]', None, None]
+        self.details['XpolarShell'] = ['', None, None]
+        self.details['sld_core'] = ['[1/A^(2)]', None, None]
+        self.details['sld_shell'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solvent'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['axis_theta'] = ['[deg]', None, None]
+        self.details['axis_phi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['equat_core.width',
+                      'X_core.width',
+                      'T_shell.width',
+                      'Xpolarshell.width',
+                      'axis_phi.width',
+                      'axis_theta.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['axis_phi',
+                                   'axis_theta',
+                                   'axis_phi.width',
+                                   'axis_theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_CoreShellEllipsoidXTModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(CoreShellEllipsoidXTModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCoreShellEllipsoidXTModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCoreShellEllipsoidXTModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CCoreShellEllipsoidXTModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CCoreShellEllipsoidXTModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CCoreShellEllipsoidXTModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CCoreShellEllipsoidXTModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/CoreShellModel.py
===================================================================
--- src/sans/models/CoreShellModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/CoreShellModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,227 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\core_shell.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CCoreShellModel
+
+def create_CoreShellModel():
+    """
+       Create a model instance
+    """
+    obj = CoreShellModel()
+    # CCoreShellModel.__init__(obj) is called by
+    # the CoreShellModel constructor
+    return obj
+
+class CoreShellModel(CCoreShellModel, BaseComponent):
+    """ 
+    Class that evaluates a CoreShellModel model. 
+    This file was auto-generated from src\sans\models\include\core_shell.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * radius          = 60.0 [A]
+    * scale           = 1.0 
+    * thickness       = 10.0 [A]
+    * core_sld        = 1e-06 [1/A^(2)]
+    * shell_sld       = 2e-06 [1/A^(2)]
+    * solvent_sld     = 3e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * M0_sld_shell    = 0.0 [1/A^(2)]
+    * M_theta_shell   = 0.0 [deg]
+    * M_phi_shell     = 0.0 [deg]
+    * M0_sld_core     = 0.0 [1/A^(2)]
+    * M_theta_core    = 0.0 [deg]
+    * M_phi_core      = 0.0 [deg]
+    * M0_sld_solv     = 0.0 [1/A^(2)]
+    * M_theta_solv    = 0.0 [deg]
+    * M_phi_solv      = 0.0 [deg]
+    * Up_frac_i       = 0.5 [u/(u+d)]
+    * Up_frac_f       = 0.5 [u/(u+d)]
+    * Up_theta        = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CCoreShellModel.__init__, (self,)) 
+
+        CCoreShellModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "CoreShellModel"
+        ## Model description
+        self.description = """
+        Form factor for a monodisperse spherical particle with particle
+		with a core-shell structure:
+		
+		The form factor is normalized by the
+		total particle volume.
+		
+		radius: core radius, thickness: shell thickness
+		
+		Ref: Guinier, A. and G. Fournet,
+		John Wiley and Sons, New York, 1955.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['radius'] = ['[A]', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['thickness'] = ['[A]', None, None]
+        self.details['core_sld'] = ['[1/A^(2)]', None, None]
+        self.details['shell_sld'] = ['[1/A^(2)]', None, None]
+        self.details['solvent_sld'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['M0_sld_shell'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_shell'] = ['[deg]', None, None]
+        self.details['M_phi_shell'] = ['[deg]', None, None]
+        self.details['M0_sld_core'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_core'] = ['[deg]', None, None]
+        self.details['M_phi_core'] = ['[deg]', None, None]
+        self.details['M0_sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_solv'] = ['[deg]', None, None]
+        self.details['M_phi_solv'] = ['[deg]', None, None]
+        self.details['Up_frac_i'] = ['[u/(u+d)]', None, None]
+        self.details['Up_frac_f'] = ['[u/(u+d)]', None, None]
+        self.details['Up_theta'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['thickness.width',
+                      'radius.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['M0_sld_shell',
+                                   'M_theta_shell',
+                                   'M_phi_shell',
+                                   'M0_sld_core',
+                                   'M_theta_core',
+                                   'M_phi_core',
+                                   'M0_sld_solv',
+                                   'M_theta_solv',
+                                   'M_phi_solv',
+                                   'Up_frac_i',
+                                   'Up_frac_f',
+                                   'Up_theta']
+
+        ## parameters with magnetism
+        self.magnetic_params = ['M0_sld_shell', 'M_theta_shell', 'M_phi_shell', 'M0_sld_core', 'M_theta_core', 'M_phi_core', 'M0_sld_solv', 'M_theta_solv', 'M_phi_solv', 'Up_frac_i', 'Up_frac_f', 'Up_theta']
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_CoreShellModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(CoreShellModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCoreShellModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCoreShellModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CCoreShellModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CCoreShellModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CCoreShellModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CCoreShellModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/CylinderModel.py
===================================================================
--- src/sans/models/CylinderModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/CylinderModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,229 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\cylinder.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CCylinderModel
+
+def create_CylinderModel():
+    """
+       Create a model instance
+    """
+    obj = CylinderModel()
+    # CCylinderModel.__init__(obj) is called by
+    # the CylinderModel constructor
+    return obj
+
+class CylinderModel(CCylinderModel, BaseComponent):
+    """ 
+    Class that evaluates a CylinderModel model. 
+    This file was auto-generated from src\sans\models\include\cylinder.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * radius          = 20.0 [A]
+    * length          = 400.0 [A]
+    * sldCyl          = 4e-06 [1/A^(2)]
+    * sldSolv         = 1e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * cyl_theta       = 60.0 [deg]
+    * cyl_phi         = 60.0 [deg]
+    * M0_sld_cyl      = 0.0 [1/A^(2)]
+    * M_theta_cyl     = 0.0 [deg]
+    * M_phi_cyl       = 0.0 [deg]
+    * M0_sld_solv     = 0.0 [1/A^(2)]
+    * M_theta_solv    = 0.0 [deg]
+    * M_phi_solv      = 0.0 [deg]
+    * Up_frac_i       = 0.5 [u/(u+d)]
+    * Up_frac_f       = 0.5 [u/(u+d)]
+    * Up_theta        = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CCylinderModel.__init__, (self,)) 
+
+        CCylinderModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "CylinderModel"
+        ## Model description
+        self.description = """
+         f(q)= 2*(sldCyl - sldSolv)*V*sin(qLcos(alpha/2))
+		/[qLcos(alpha/2)]*J1(qRsin(alpha/2))/[qRsin(alpha)]
+		
+		P(q,alpha)= scale/V*f(q)^(2)+bkg
+		V: Volume of the cylinder
+		R: Radius of the cylinder
+		L: Length of the cylinder
+		J1: The bessel function
+		alpha: angle betweenthe axis of the
+		cylinder and the q-vector for 1D
+		:the ouput is P(q)=scale/V*integral
+		from pi/2 to zero of...
+		f(q)^(2)*sin(alpha)*dalpha+ bkg
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['length'] = ['[A]', None, None]
+        self.details['sldCyl'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['cyl_theta'] = ['[deg]', None, None]
+        self.details['cyl_phi'] = ['[deg]', None, None]
+        self.details['M0_sld_cyl'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_cyl'] = ['[deg]', None, None]
+        self.details['M_phi_cyl'] = ['[deg]', None, None]
+        self.details['M0_sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_solv'] = ['[deg]', None, None]
+        self.details['M_phi_solv'] = ['[deg]', None, None]
+        self.details['Up_frac_i'] = ['[u/(u+d)]', None, None]
+        self.details['Up_frac_f'] = ['[u/(u+d)]', None, None]
+        self.details['Up_theta'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['cyl_phi.width',
+                      'cyl_theta.width',
+                      'length.width',
+                      'radius.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['cyl_phi',
+                                   'cyl_theta',
+                                   'cyl_phi.width',
+                                   'cyl_theta.width',
+                                   'M0_sld_cyl',
+                                   'M_theta_cyl',
+                                   'M_phi_cyl',
+                                   'M0_sld_solv',
+                                   'M_theta_solv',
+                                   'M_phi_solv',
+                                   'Up_frac_i',
+                                   'Up_frac_f',
+                                   'Up_theta']
+
+        ## parameters with magnetism
+        self.magnetic_params = ['M0_sld_cyl', 'M_theta_cyl', 'M_phi_cyl', 'M0_sld_solv', 'M_theta_solv', 'M_phi_solv', 'Up_frac_i', 'Up_frac_f', 'Up_theta']
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_CylinderModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(CylinderModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCylinderModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CCylinderModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CCylinderModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CCylinderModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CCylinderModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CCylinderModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/DABModel.py
===================================================================
--- src/sans/models/DABModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/DABModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,175 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\dabmodel.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CDABModel
+
+def create_DABModel():
+    """
+       Create a model instance
+    """
+    obj = DABModel()
+    # CDABModel.__init__(obj) is called by
+    # the DABModel constructor
+    return obj
+
+class DABModel(CDABModel, BaseComponent):
+    """ 
+    Class that evaluates a DABModel model. 
+    This file was auto-generated from src\sans\models\include\dabmodel.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * length          = 50.0 [A]
+    * scale           = 1.0 
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CDABModel.__init__, (self,)) 
+
+        CDABModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "DABModel"
+        ## Model description
+        self.description = """
+        Provide F(x) = scale/( 1 + (x*L)^2 )^(2) + background
+		DAB (Debye Anderson Brumberger) function as a BaseComponent model
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['length'] = ['[A]', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_DABModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(DABModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CDABModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CDABModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CDABModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CDABModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CDABModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CDABModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/DiamCylFunc.py
===================================================================
--- src/sans/models/DiamCylFunc.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/DiamCylFunc.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,176 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\DiamCyl.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CDiamCylFunc
+
+def create_DiamCylFunc():
+    """
+       Create a model instance
+    """
+    obj = DiamCylFunc()
+    # CDiamCylFunc.__init__(obj) is called by
+    # the DiamCylFunc constructor
+    return obj
+
+class DiamCylFunc(CDiamCylFunc, BaseComponent):
+    """ 
+    Class that evaluates a DiamCylFunc model. 
+    This file was auto-generated from src\sans\models\include\DiamCyl.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * radius          = 20.0 A
+    * length          = 400.0 A
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CDiamCylFunc.__init__, (self,)) 
+
+        CDiamCylFunc.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "DiamCylFunc"
+        ## Model description
+        self.description = """
+        To calculate the 2nd virial coefficient for
+		the non-spherical object, then find the
+		radius of sphere that has this value of
+		virial coefficient.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['radius'] = ['A', None, None]
+        self.details['length'] = ['A', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius.width',
+                      'length.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_DiamCylFunc, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(DiamCylFunc())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CDiamCylFunc.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CDiamCylFunc.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CDiamCylFunc.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CDiamCylFunc.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CDiamCylFunc.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CDiamCylFunc.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/DiamEllipFunc.py
===================================================================
--- src/sans/models/DiamEllipFunc.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/DiamEllipFunc.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,180 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\DiamEllip.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CDiamEllipFunc
+
+def create_DiamEllipFunc():
+    """
+       Create a model instance
+    """
+    obj = DiamEllipFunc()
+    # CDiamEllipFunc.__init__(obj) is called by
+    # the DiamEllipFunc constructor
+    return obj
+
+class DiamEllipFunc(CDiamEllipFunc, BaseComponent):
+    """ 
+    Class that evaluates a DiamEllipFunc model. 
+    This file was auto-generated from src\sans\models\include\DiamEllip.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * radius_a        = 20.0 A
+    * radius_b        = 400.0 A
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CDiamEllipFunc.__init__, (self,)) 
+
+        CDiamEllipFunc.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "DiamEllipFunc"
+        ## Model description
+        self.description = """
+        To calculate the 2nd virial coefficient for
+		the non-spherical object, then find the
+		radius of sphere that has this value of
+		virial coefficient:
+		radius_a = polar radius,
+		radius_b = equatorial radius;
+		radius_a > radius_b: Prolate spheroid,
+		radius_a < radius_b: Oblate spheroid.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['radius_a'] = ['A', None, None]
+        self.details['radius_b'] = ['A', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius_a.width',
+                      'radius_b.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_DiamEllipFunc, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(DiamEllipFunc())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CDiamEllipFunc.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CDiamEllipFunc.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CDiamEllipFunc.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CDiamEllipFunc.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CDiamEllipFunc.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CDiamEllipFunc.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/EllipsoidModel.py
===================================================================
--- src/sans/models/EllipsoidModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/EllipsoidModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,208 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\ellipsoid.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CEllipsoidModel
+
+def create_EllipsoidModel():
+    """
+       Create a model instance
+    """
+    obj = EllipsoidModel()
+    # CEllipsoidModel.__init__(obj) is called by
+    # the EllipsoidModel constructor
+    return obj
+
+class EllipsoidModel(CEllipsoidModel, BaseComponent):
+    """ 
+    Class that evaluates a EllipsoidModel model. 
+    This file was auto-generated from src\sans\models\include\ellipsoid.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * radius_a        = 20.0 [A]
+    * scale           = 1.0 
+    * radius_b        = 400.0 [A]
+    * sldEll          = 4e-06 [1/A^(2)]
+    * sldSolv         = 1e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * axis_theta      = 90.0 [deg]
+    * axis_phi        = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CEllipsoidModel.__init__, (self,)) 
+
+        CEllipsoidModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "EllipsoidModel"
+        ## Model description
+        self.description = """
+        "P(q.alpha)= scale*f(q)^(2)+ bkg, where f(q)= 3*(sld_ell
+		- sld_solvent)*V*[sin(q*r(Ra,Rb,alpha))
+		-q*r*cos(qr(Ra,Rb,alpha))]
+		/[qr(Ra,Rb,alpha)]^(3)"
+		
+		r(Ra,Rb,alpha)= [Rb^(2)*(sin(alpha))^(2)
+		+ Ra^(2)*(cos(alpha))^(2)]^(1/2)
+		
+		scatter_sld: SLD of the scatter
+		solvent_sld: SLD of the solvent
+		sldEll: SLD of ellipsoid
+		sldSolv: SLD of solvent
+		V: volune of the Eliipsoid
+		Ra: radius along the rotation axis
+		of the Ellipsoid
+		Rb: radius perpendicular to the
+		rotation axis of the ellipsoid
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['radius_a'] = ['[A]', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['radius_b'] = ['[A]', None, None]
+        self.details['sldEll'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['axis_theta'] = ['[deg]', None, None]
+        self.details['axis_phi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['axis_phi.width',
+                      'axis_theta.width',
+                      'radius_a.width',
+                      'radius_b.width',
+                      'length.width',
+                      'r_minor.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['axis_phi.width',
+                                   'axis_theta.width',
+                                   'axis_phi',
+                                   'axis_theta']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_EllipsoidModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(EllipsoidModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CEllipsoidModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CEllipsoidModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CEllipsoidModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CEllipsoidModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CEllipsoidModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CEllipsoidModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/EllipticalCylinderModel.py
===================================================================
--- src/sans/models/EllipticalCylinderModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/EllipticalCylinderModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,203 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\elliptical_cylinder.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CEllipticalCylinderModel
+
+def create_EllipticalCylinderModel():
+    """
+       Create a model instance
+    """
+    obj = EllipticalCylinderModel()
+    # CEllipticalCylinderModel.__init__(obj) is called by
+    # the EllipticalCylinderModel constructor
+    return obj
+
+class EllipticalCylinderModel(CEllipticalCylinderModel, BaseComponent):
+    """ 
+    Class that evaluates a EllipticalCylinderModel model. 
+    This file was auto-generated from src\sans\models\include\elliptical_cylinder.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * r_minor         = 20.0 [A]
+    * scale           = 1.0 
+    * r_ratio         = 1.5 
+    * length          = 400.0 [A]
+    * sldCyl          = 4e-06 [1/A^(2)]
+    * sldSolv         = 1e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * cyl_theta       = 90.0 [deg]
+    * cyl_phi         = 0.0 [deg]
+    * cyl_psi         = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CEllipticalCylinderModel.__init__, (self,)) 
+
+        CEllipticalCylinderModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "EllipticalCylinderModel"
+        ## Model description
+        self.description = """
+         Model parameters: r_minor = the radius of minor axis of the cross section
+		r_ratio = the ratio of (r_major /r_minor >= 1)
+		length = the length of the cylinder
+		sldCyl = SLD of the cylinder
+		sldSolv = SLD of solvent -
+		background = incoherent background
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['r_minor'] = ['[A]', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['r_ratio'] = ['', None, None]
+        self.details['length'] = ['[A]', None, None]
+        self.details['sldCyl'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['cyl_theta'] = ['[deg]', None, None]
+        self.details['cyl_phi'] = ['[deg]', None, None]
+        self.details['cyl_psi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['cyl_phi.width',
+                      'cyl_theta.width',
+                      'cyl_psi.width',
+                      'length.width',
+                      'r_minor.width',
+                      'r_ratio.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['cyl_phi',
+                                   'cyl_theta',
+                                   'cyl_psi',
+                                   'cyl_phi.width',
+                                   'cyl_theta.width',
+                                   'cyl_psi.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_EllipticalCylinderModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(EllipticalCylinderModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CEllipticalCylinderModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CEllipticalCylinderModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CEllipticalCylinderModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CEllipticalCylinderModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CEllipticalCylinderModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CEllipticalCylinderModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/FCCrystalModel.py
===================================================================
--- src/sans/models/FCCrystalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/FCCrystalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,213 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\fcc.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CFCCrystalModel
+
+def create_FCCrystalModel():
+    """
+       Create a model instance
+    """
+    obj = FCCrystalModel()
+    # CFCCrystalModel.__init__(obj) is called by
+    # the FCCrystalModel constructor
+    return obj
+
+class FCCrystalModel(CFCCrystalModel, BaseComponent):
+    """ 
+    Class that evaluates a FCCrystalModel model. 
+    This file was auto-generated from src\sans\models\include\fcc.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * dnn             = 220.0 [A]
+    * d_factor        = 0.06 
+    * radius          = 40.0 [A]
+    * sldSph          = 3e-06 [1/A^(2)]
+    * sldSolv         = 6.3e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * theta           = 0.0 [deg]
+    * phi             = 0.0 [deg]
+    * psi             = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CFCCrystalModel.__init__, (self,)) 
+
+        CFCCrystalModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "FCCrystalModel"
+        ## Model description
+        self.description = """
+        P(q)=(scale/Vp)*V_lattice*P(q)*Z(q)+bkg where scale is the volume
+		fraction of sphere,
+		Vp = volume of the primary particle,
+		V_lattice = volume correction for
+		for the crystal structure,
+		P(q)= form factor of the sphere (normalized),
+		Z(q)= paracrystalline structure factor
+		for a face centered cubic structure.
+		[Face Centered Cubic ParaCrystal Model]
+		Parameters;
+		scale: volume fraction of spheres
+		bkg:background, R: radius of sphere
+		dnn: Nearest neighbor distance
+		d_factor: Paracrystal distortion factor
+		radius: radius of the spheres
+		sldSph: SLD of the sphere
+		sldSolv: SLD of the solvent
+		
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['dnn'] = ['[A]', None, None]
+        self.details['d_factor'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['sldSph'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['theta'] = ['[deg]', None, None]
+        self.details['phi'] = ['[deg]', None, None]
+        self.details['psi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius.width',
+                      'phi.width',
+                      'psi.width',
+                      'theta.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['phi',
+                                   'psi',
+                                   'theta',
+                                   'phi.width',
+                                   'psi.width',
+                                   'theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_FCCrystalModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(FCCrystalModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CFCCrystalModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CFCCrystalModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CFCCrystalModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CFCCrystalModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CFCCrystalModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CFCCrystalModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/FlexCylEllipXModel.py
===================================================================
--- src/sans/models/FlexCylEllipXModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/FlexCylEllipXModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,190 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\flexcyl_ellipX.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CFlexCylEllipXModel
+
+def create_FlexCylEllipXModel():
+    """
+       Create a model instance
+    """
+    obj = FlexCylEllipXModel()
+    # CFlexCylEllipXModel.__init__(obj) is called by
+    # the FlexCylEllipXModel constructor
+    return obj
+
+class FlexCylEllipXModel(CFlexCylEllipXModel, BaseComponent):
+    """ 
+    Class that evaluates a FlexCylEllipXModel model. 
+    This file was auto-generated from src\sans\models\include\flexcyl_ellipX.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * length          = 1000.0 [A]
+    * kuhn_length     = 100.0 [A]
+    * radius          = 20.0 [A]
+    * axis_ratio      = 1.5 
+    * sldCyl          = 1e-06 [1/A^(2)]
+    * sldSolv         = 6.3e-06 [1/A^(2)]
+    * background      = 0.0001 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CFlexCylEllipXModel.__init__, (self,)) 
+
+        CFlexCylEllipXModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "FlexCylEllipXModel"
+        ## Model description
+        self.description = """
+         Note : scale and contrast=sldCyl-sldSolv are both multiplicative factors in the
+		model and are perfectly correlated. One or
+		both of these parameters must be held fixed
+		during model fitting.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['length'] = ['[A]', None, None]
+        self.details['kuhn_length'] = ['[A]', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['axis_ratio'] = ['', None, None]
+        self.details['sldCyl'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['length.width',
+                      'kuhn_length.width',
+                      'radius.width',
+                      'axis_ratio.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_FlexCylEllipXModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(FlexCylEllipXModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CFlexCylEllipXModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CFlexCylEllipXModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CFlexCylEllipXModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CFlexCylEllipXModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CFlexCylEllipXModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CFlexCylEllipXModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/FlexibleCylinderModel.py
===================================================================
--- src/sans/models/FlexibleCylinderModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/FlexibleCylinderModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,187 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\flexible_cylinder.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CFlexibleCylinderModel
+
+def create_FlexibleCylinderModel():
+    """
+       Create a model instance
+    """
+    obj = FlexibleCylinderModel()
+    # CFlexibleCylinderModel.__init__(obj) is called by
+    # the FlexibleCylinderModel constructor
+    return obj
+
+class FlexibleCylinderModel(CFlexibleCylinderModel, BaseComponent):
+    """ 
+    Class that evaluates a FlexibleCylinderModel model. 
+    This file was auto-generated from src\sans\models\include\flexible_cylinder.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * length          = 1000.0 [A]
+    * kuhn_length     = 100.0 [A]
+    * radius          = 20.0 [A]
+    * sldCyl          = 1e-06 [1/A^(2)]
+    * sldSolv         = 6.3e-06 [1/A^(2)]
+    * background      = 0.0001 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CFlexibleCylinderModel.__init__, (self,)) 
+
+        CFlexibleCylinderModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "FlexibleCylinderModel"
+        ## Model description
+        self.description = """
+         Note : scale and contrast=sldCyl-sldSolv are both multiplicative factors in the
+		model and are perfectly correlated. One or
+		both of these parameters must be held fixed
+		during model fitting.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['length'] = ['[A]', None, None]
+        self.details['kuhn_length'] = ['[A]', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['sldCyl'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['length.width',
+                      'kuhn_length.width',
+                      'radius.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_FlexibleCylinderModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(FlexibleCylinderModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CFlexibleCylinderModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CFlexibleCylinderModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CFlexibleCylinderModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CFlexibleCylinderModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CFlexibleCylinderModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CFlexibleCylinderModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/FractalModel.py
===================================================================
--- src/sans/models/FractalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/FractalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,192 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\fractal.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CFractalModel
+
+def create_FractalModel():
+    """
+       Create a model instance
+    """
+    obj = FractalModel()
+    # CFractalModel.__init__(obj) is called by
+    # the FractalModel constructor
+    return obj
+
+class FractalModel(CFractalModel, BaseComponent):
+    """ 
+    Class that evaluates a FractalModel model. 
+    This file was auto-generated from src\sans\models\include\fractal.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * radius          = 5.0 [A]
+    * scale           = 0.05 
+    * fractal_dim     = 2.0 
+    * cor_length      = 100.0 [A]
+    * sldBlock        = 2e-06 [1/A^(2)]
+    * sldSolv         = 6.35e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CFractalModel.__init__, (self,)) 
+
+        CFractalModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "FractalModel"
+        ## Model description
+        self.description = """
+         The scattering intensity  I(x) = P(|x|)*S(|x|) + background, where
+		p(x)= scale * V * delta^(2)* F(x*radius)^(2)
+		F(x) = 3*[sin(x)-x cos(x)]/x**3
+		where delta = sldBlock -sldSolv.
+		scale        =  scale factor * Volume fraction
+		radius       =  Block radius
+		fractal_dim  =  Fractal dimension
+		cor_length  =  Correlation Length
+		sldBlock    =  SDL block
+		sldSolv  =  SDL solvent
+		background   =  background
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['radius'] = ['[A]', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['fractal_dim'] = ['', None, None]
+        self.details['cor_length'] = ['[A]', None, None]
+        self.details['sldBlock'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_FractalModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(FractalModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CFractalModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CFractalModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CFractalModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CFractalModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CFractalModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CFractalModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/FractalO_Z.py
===================================================================
--- src/sans/models/FractalO_Z.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/FractalO_Z.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,182 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\FractalQtoN.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CFractalO_Z
+
+def create_FractalO_Z():
+    """
+       Create a model instance
+    """
+    obj = FractalO_Z()
+    # CFractalO_Z.__init__(obj) is called by
+    # the FractalO_Z constructor
+    return obj
+
+class FractalO_Z(CFractalO_Z, BaseComponent):
+    """ 
+    Class that evaluates a FractalO_Z model. 
+    This file was auto-generated from src\sans\models\include\FractalQtoN.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 10000.0 
+    * m_fractal       = 1.8 
+    * cluster_rg      = 3520.0 
+    * s_fractal       = 2.5 
+    * primary_rg      = 82.0 
+    * background      = 0.01 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CFractalO_Z.__init__, (self,)) 
+
+        CFractalO_Z.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "FractalO_Z"
+        ## Model description
+        self.description = """
+        Structure factor for interacting particles:
+		Schmidt J Appl Cryst (1991), 24, 414-435 See equation (19)
+		Hurd; Schaefer; Martin, Phys Rev A (1987), 35, 2361-2364 See equation (2).
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['m_fractal'] = ['', None, None]
+        self.details['cluster_rg'] = ['', None, None]
+        self.details['s_fractal'] = ['', None, None]
+        self.details['primary_rg'] = ['', None, None]
+        self.details['background'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_FractalO_Z, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(FractalO_Z())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CFractalO_Z.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CFractalO_Z.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CFractalO_Z.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CFractalO_Z.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CFractalO_Z.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CFractalO_Z.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/FuzzySphereModel.py
===================================================================
--- src/sans/models/FuzzySphereModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/FuzzySphereModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,190 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\fuzzysphere.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CFuzzySphereModel
+
+def create_FuzzySphereModel():
+    """
+       Create a model instance
+    """
+    obj = FuzzySphereModel()
+    # CFuzzySphereModel.__init__(obj) is called by
+    # the FuzzySphereModel constructor
+    return obj
+
+class FuzzySphereModel(CFuzzySphereModel, BaseComponent):
+    """ 
+    Class that evaluates a FuzzySphereModel model. 
+    This file was auto-generated from src\sans\models\include\fuzzysphere.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * radius          = 60.0 [A]
+    * scale           = 0.01 
+    * fuzziness       = 10.0 [A]
+    * sldSph          = 1e-06 [1/A^(2)]
+    * sldSolv         = 3e-06 [1/A^(2)]
+    * background      = 0.001 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CFuzzySphereModel.__init__, (self,)) 
+
+        CFuzzySphereModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "FuzzySphereModel"
+        ## Model description
+        self.description = """
+        
+		scale: scale factor times volume fraction,
+		or just volume fraction for absolute scale data
+		radius: radius of the solid sphere
+		fuzziness = the STD of the height of fuzzy interfacial
+		thickness (ie., so-called interfacial roughness)
+		sldSph: the SLD of the sphere
+		sldSolv: the SLD of the solvent
+		background: incoherent background
+		Note: By definition, this function works only when fuzziness << radius.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['radius'] = ['[A]', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['fuzziness'] = ['[A]', None, None]
+        self.details['sldSph'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius.width',
+                      'fuzziness.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_FuzzySphereModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(FuzzySphereModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CFuzzySphereModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CFuzzySphereModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CFuzzySphereModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CFuzzySphereModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CFuzzySphereModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CFuzzySphereModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/Gaussian.py
===================================================================
--- src/sans/models/Gaussian.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/Gaussian.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,174 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\gaussian.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CGaussian
+
+def create_Gaussian():
+    """
+       Create a model instance
+    """
+    obj = Gaussian()
+    # CGaussian.__init__(obj) is called by
+    # the Gaussian constructor
+    return obj
+
+class Gaussian(CGaussian, BaseComponent):
+    """ 
+    Class that evaluates a Gaussian model. 
+    This file was auto-generated from src\sans\models\include\gaussian.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * sigma           = 1.0 
+    * center          = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CGaussian.__init__, (self,)) 
+
+        CGaussian.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "Gaussian"
+        ## Model description
+        self.description = """
+        f(x)=scale * 1/(sigma^2*2pi)e^(-(x-mu)^2/2sigma^2)
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['sigma'] = ['', None, None]
+        self.details['center'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_Gaussian, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(Gaussian())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CGaussian.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CGaussian.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CGaussian.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CGaussian.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CGaussian.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CGaussian.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/GelFitModel.py
===================================================================
--- src/sans/models/GelFitModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/GelFitModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,185 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\GelFit.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CGelFitModel
+
+def create_GelFitModel():
+    """
+       Create a model instance
+    """
+    obj = GelFitModel()
+    # CGelFitModel.__init__(obj) is called by
+    # the GelFitModel constructor
+    return obj
+
+class GelFitModel(CGelFitModel, BaseComponent):
+    """ 
+    Class that evaluates a GelFitModel model. 
+    This file was auto-generated from src\sans\models\include\GelFit.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * lScale          = 3.5 
+    * gScale          = 1.7 
+    * zeta            = 16.0 
+    * radius          = 104.0 
+    * scale           = 2.0 
+    * background      = 0.01 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CGelFitModel.__init__, (self,)) 
+
+        CGelFitModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "GelFitModel"
+        ## Model description
+        self.description = """
+        Structure factor for interacting particles:                   .
+		Shibayama-Geissler Two-Length Scale Fit for Gels
+		(GelFit)
+		
+		Sibayama; Tanaka; Han J Chem Phys(1992), 97(9), 6829-6841
+		Mallam; Horkay; Hecht; Rennie; Geissler, Macromol(1991), 24, 543
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['lScale'] = ['', None, None]
+        self.details['gScale'] = ['', None, None]
+        self.details['zeta'] = ['', None, None]
+        self.details['radius'] = ['', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['background'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_GelFitModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(GelFitModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CGelFitModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CGelFitModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CGelFitModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CGelFitModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CGelFitModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CGelFitModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/HardsphereStructure.py
===================================================================
--- src/sans/models/HardsphereStructure.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/HardsphereStructure.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,183 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\Hardsphere.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CHardsphereStructure
+
+def create_HardsphereStructure():
+    """
+       Create a model instance
+    """
+    obj = HardsphereStructure()
+    # CHardsphereStructure.__init__(obj) is called by
+    # the HardsphereStructure constructor
+    return obj
+
+class HardsphereStructure(CHardsphereStructure, BaseComponent):
+    """ 
+    Class that evaluates a HardsphereStructure model. 
+    This file was auto-generated from src\sans\models\include\Hardsphere.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * effect_radius   = 50.0 [A]
+    * volfraction     = 0.2 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CHardsphereStructure.__init__, (self,)) 
+
+        CHardsphereStructure.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "HardsphereStructure"
+        ## Model description
+        self.description = """
+        Structure factor for interacting particles:                   .
+		
+		The interparticle potential is
+		
+		U(r)= inf   , r < 2R
+		= 0     , r >= 2R
+		
+		R: effective radius of the Hardsphere particle
+		V:The volume fraction
+		
+		Ref: Percus., J. K.,etc., J. Phy.
+		Rev. 1958, 110, 1.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['effect_radius'] = ['[A]', None, None]
+        self.details['volfraction'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = ['effect_radius.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_HardsphereStructure, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(HardsphereStructure())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CHardsphereStructure.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CHardsphereStructure.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CHardsphereStructure.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CHardsphereStructure.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CHardsphereStructure.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CHardsphereStructure.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/HayterMSAStructure.py
===================================================================
--- src/sans/models/HayterMSAStructure.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/HayterMSAStructure.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,193 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\HayterMSA.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CHayterMSAStructure
+
+def create_HayterMSAStructure():
+    """
+       Create a model instance
+    """
+    obj = HayterMSAStructure()
+    # CHayterMSAStructure.__init__(obj) is called by
+    # the HayterMSAStructure constructor
+    return obj
+
+class HayterMSAStructure(CHayterMSAStructure, BaseComponent):
+    """ 
+    Class that evaluates a HayterMSAStructure model. 
+    This file was auto-generated from src\sans\models\include\HayterMSA.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * effect_radius   = 20.75 [A]
+    * charge          = 19.0 
+    * volfraction     = 0.0192 
+    * temperature     = 318.16 [K]
+    * saltconc        = 0.0 [M]
+    * dielectconst    = 71.08 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CHayterMSAStructure.__init__, (self,)) 
+
+        CHayterMSAStructure.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "HayterMSAStructure"
+        ## Model description
+        self.description = """
+        To calculate the structure factor (the Fourier transform of the
+		pair correlation function g(r)) for a system of
+		charged, spheroidal objects in a dielectric
+		medium.
+		When combined with an appropriate form
+		factor, this allows for inclusion of
+		the interparticle interference effects
+		due to screened coulomb repulsion between
+		charged particles.
+		(Note: charge > 0 required.)
+		
+		Ref: JP Hansen and JB Hayter, Molecular
+		Physics 46, 651-656 (1982).
+		
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['effect_radius'] = ['[A]', None, None]
+        self.details['charge'] = ['', None, None]
+        self.details['volfraction'] = ['', None, None]
+        self.details['temperature'] = ['[K]', None, None]
+        self.details['saltconc'] = ['[M]', None, None]
+        self.details['dielectconst'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = ['effect_radius.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_HayterMSAStructure, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(HayterMSAStructure())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CHayterMSAStructure.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CHayterMSAStructure.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CHayterMSAStructure.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CHayterMSAStructure.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CHayterMSAStructure.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CHayterMSAStructure.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/HollowCylinderModel.py
===================================================================
--- src/sans/models/HollowCylinderModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/HollowCylinderModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,199 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\hollow_cylinder.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CHollowCylinderModel
+
+def create_HollowCylinderModel():
+    """
+       Create a model instance
+    """
+    obj = HollowCylinderModel()
+    # CHollowCylinderModel.__init__(obj) is called by
+    # the HollowCylinderModel constructor
+    return obj
+
+class HollowCylinderModel(CHollowCylinderModel, BaseComponent):
+    """ 
+    Class that evaluates a HollowCylinderModel model. 
+    This file was auto-generated from src\sans\models\include\hollow_cylinder.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * core_radius     = 20.0 [A]
+    * radius          = 30.0 [A]
+    * length          = 400.0 [A]
+    * sldCyl          = 6.3e-06 [1/A^(2)]
+    * sldSolv         = 1e-06 [1/A^(2)]
+    * background      = 0.01 [1/cm]
+    * axis_theta      = 90.0 [deg]
+    * axis_phi        = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CHollowCylinderModel.__init__, (self,)) 
+
+        CHollowCylinderModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "HollowCylinderModel"
+        ## Model description
+        self.description = """
+         P(q) = scale*<f*f>/Vol + bkg, where f is the scattering amplitude.
+		core_radius = the radius of core
+		radius = the radius of shell
+		length = the total length of the cylinder
+		sldCyl = SLD of the shell
+		sldSolv = SLD of the solvent
+		background = incoherent background
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['core_radius'] = ['[A]', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['length'] = ['[A]', None, None]
+        self.details['sldCyl'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['axis_theta'] = ['[deg]', None, None]
+        self.details['axis_phi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['axis_phi.width',
+                      'axis_theta.width',
+                      'length.width',
+                      'core_radius.width',
+                      'radius']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['axis_phi',
+                                   'axis_theta',
+                                   'axis_phi.width',
+                                   'axis_theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_HollowCylinderModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(HollowCylinderModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CHollowCylinderModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CHollowCylinderModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CHollowCylinderModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CHollowCylinderModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CHollowCylinderModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CHollowCylinderModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/LamellarFFHGModel.py
===================================================================
--- src/sans/models/LamellarFFHGModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/LamellarFFHGModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,190 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\lamellarFF_HG.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CLamellarFFHGModel
+
+def create_LamellarFFHGModel():
+    """
+       Create a model instance
+    """
+    obj = LamellarFFHGModel()
+    # CLamellarFFHGModel.__init__(obj) is called by
+    # the LamellarFFHGModel constructor
+    return obj
+
+class LamellarFFHGModel(CLamellarFFHGModel, BaseComponent):
+    """ 
+    Class that evaluates a LamellarFFHGModel model. 
+    This file was auto-generated from src\sans\models\include\lamellarFF_HG.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * t_length        = 15.0 [A]
+    * h_thickness     = 10.0 [A]
+    * sld_tail        = 4e-07 [1/A^(2)]
+    * sld_head        = 3e-06 [1/A^(2)]
+    * sld_solvent     = 6e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CLamellarFFHGModel.__init__, (self,)) 
+
+        CLamellarFFHGModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "LamellarFFHGModel"
+        ## Model description
+        self.description = """
+         Parameters: t_length = tail length, h_thickness = head thickness,
+		scale = Scale factor,
+		background = incoherent Background
+		sld_tail = tail scattering length density ,
+		sld_solvent = solvent scattering length density.
+		NOTE: The total bilayer thickness
+		= 2(h_thickness+ t_length).
+		
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['t_length'] = ['[A]', None, None]
+        self.details['h_thickness'] = ['[A]', None, None]
+        self.details['sld_tail'] = ['[1/A^(2)]', None, None]
+        self.details['sld_head'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solvent'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['t_length.width',
+                      'h_thickness.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_LamellarFFHGModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(LamellarFFHGModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLamellarFFHGModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLamellarFFHGModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CLamellarFFHGModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CLamellarFFHGModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CLamellarFFHGModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CLamellarFFHGModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/LamellarModel.py
===================================================================
--- src/sans/models/LamellarModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/LamellarModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,186 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\lamellar.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CLamellarModel
+
+def create_LamellarModel():
+    """
+       Create a model instance
+    """
+    obj = LamellarModel()
+    # CLamellarModel.__init__(obj) is called by
+    # the LamellarModel constructor
+    return obj
+
+class LamellarModel(CLamellarModel, BaseComponent):
+    """ 
+    Class that evaluates a LamellarModel model. 
+    This file was auto-generated from src\sans\models\include\lamellar.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * bi_thick        = 50.0 [A]
+    * sld_bi          = 1e-06 [1/A^(2)]
+    * sld_sol         = 6.3e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CLamellarModel.__init__, (self,)) 
+
+        CLamellarModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "LamellarModel"
+        ## Model description
+        self.description = """
+        [Dilute Lamellar Form Factor](from a lyotropic lamellar phase)
+		I(q)= 2*pi*P(q)/(delta *q^(2)), where
+		P(q)=2*(contrast/q)^(2)*(1-cos(q*delta))^(2))
+		bi_thick = bilayer thickness
+		sld_bi = SLD of bilayer
+		sld_sol = SLD of solvent
+		background = Incoherent background
+		scale = scale factor
+		
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['bi_thick'] = ['[A]', None, None]
+        self.details['sld_bi'] = ['[1/A^(2)]', None, None]
+        self.details['sld_sol'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_LamellarModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(LamellarModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLamellarModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLamellarModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CLamellarModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CLamellarModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CLamellarModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CLamellarModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/LamellarPCrystalModel.py
===================================================================
--- src/sans/models/LamellarPCrystalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/LamellarPCrystalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,194 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\lamellarPC.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CLamellarPCrystalModel
+
+def create_LamellarPCrystalModel():
+    """
+       Create a model instance
+    """
+    obj = LamellarPCrystalModel()
+    # CLamellarPCrystalModel.__init__(obj) is called by
+    # the LamellarPCrystalModel constructor
+    return obj
+
+class LamellarPCrystalModel(CLamellarPCrystalModel, BaseComponent):
+    """ 
+    Class that evaluates a LamellarPCrystalModel model. 
+    This file was auto-generated from src\sans\models\include\lamellarPC.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * thickness       = 33.0 [A]
+    * Nlayers         = 20.0 
+    * spacing         = 250.0 [A]
+    * pd_spacing      = 0.0 
+    * sld_layer       = 1e-06 [1/A^(2)]
+    * sld_solvent     = 6.34e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CLamellarPCrystalModel.__init__, (self,)) 
+
+        CLamellarPCrystalModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "LamellarPCrystalModel"
+        ## Model description
+        self.description = """
+        [Lamellar ParaCrystal Model] Parameter Definitions: scale = scale factor,
+		background = incoherent background
+		thickness = lamellar thickness,
+		sld_layer = layer scattering length density ,
+		sld_solvent = solvent scattering length density.
+		Nlayers = no. of lamellar layers
+		spacing = spacing between layers
+		pd_spacing = polydispersity of spacing
+		Note: This model can be used for large
+		multilamellar vesicles.
+		
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['thickness'] = ['[A]', None, None]
+        self.details['Nlayers'] = ['', None, None]
+        self.details['spacing'] = ['[A]', None, None]
+        self.details['pd_spacing'] = ['', None, None]
+        self.details['sld_layer'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solvent'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['thickness.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_LamellarPCrystalModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(LamellarPCrystalModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLamellarPCrystalModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLamellarPCrystalModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CLamellarPCrystalModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CLamellarPCrystalModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CLamellarPCrystalModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CLamellarPCrystalModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/LamellarPSHGModel.py
===================================================================
--- src/sans/models/LamellarPSHGModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/LamellarPSHGModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,208 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\lamellarPS_HG.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CLamellarPSHGModel
+
+def create_LamellarPSHGModel():
+    """
+       Create a model instance
+    """
+    obj = LamellarPSHGModel()
+    # CLamellarPSHGModel.__init__(obj) is called by
+    # the LamellarPSHGModel constructor
+    return obj
+
+class LamellarPSHGModel(CLamellarPSHGModel, BaseComponent):
+    """ 
+    Class that evaluates a LamellarPSHGModel model. 
+    This file was auto-generated from src\sans\models\include\lamellarPS_HG.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * spacing         = 40.0 [A]
+    * deltaT          = 10.0 [A]
+    * deltaH          = 2.0 [A]
+    * sld_tail        = 4e-07 [1/A^(2)]
+    * sld_head        = 2e-06 [1/A^(2)]
+    * sld_solvent     = 6e-06 [1/A^(2)]
+    * n_plates        = 30.0 
+    * caille          = 0.001 
+    * background      = 0.001 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CLamellarPSHGModel.__init__, (self,)) 
+
+        CLamellarPSHGModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "LamellarPSHGModel"
+        ## Model description
+        self.description = """
+        [Concentrated Lamellar (head+tail) Form Factor]: Calculates the
+		intensity from a lyotropic lamellar phase.
+		The intensity (form factor and structure factor)
+		calculated is for lamellae of two-layer scattering
+		length density that are randomly distributed in
+		solution (a powder average). The scattering
+		length density of the tail region, headgroup
+		region, and solvent are taken to be different.
+		The model can also be applied to large,
+		multi-lamellar vesicles.
+		No resolution smeared version is included
+		in the structure factor of this model.
+		*Parameters: spacing = repeat spacing,
+		deltaT = tail length,
+		deltaH = headgroup thickness,
+		n_plates = # of Lamellar plates
+		caille = Caille parameter (<0.8 or <1)
+		background = incoherent bgd
+		scale = scale factor ...
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['spacing'] = ['[A]', None, None]
+        self.details['deltaT'] = ['[A]', None, None]
+        self.details['deltaH'] = ['[A]', None, None]
+        self.details['sld_tail'] = ['[1/A^(2)]', None, None]
+        self.details['sld_head'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solvent'] = ['[1/A^(2)]', None, None]
+        self.details['n_plates'] = ['', None, None]
+        self.details['caille'] = ['', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['deltaT.width',
+                      'deltaH.width',
+                      'spacing.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_LamellarPSHGModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(LamellarPSHGModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLamellarPSHGModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLamellarPSHGModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CLamellarPSHGModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CLamellarPSHGModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CLamellarPSHGModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CLamellarPSHGModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/LamellarPSModel.py
===================================================================
--- src/sans/models/LamellarPSModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/LamellarPSModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,203 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\lamellarPS.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CLamellarPSModel
+
+def create_LamellarPSModel():
+    """
+       Create a model instance
+    """
+    obj = LamellarPSModel()
+    # CLamellarPSModel.__init__(obj) is called by
+    # the LamellarPSModel constructor
+    return obj
+
+class LamellarPSModel(CLamellarPSModel, BaseComponent):
+    """ 
+    Class that evaluates a LamellarPSModel model. 
+    This file was auto-generated from src\sans\models\include\lamellarPS.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * spacing         = 400.0 [A]
+    * delta           = 30.0 [A]
+    * sld_bi          = 6.3e-06 [1/A^(2)]
+    * sld_sol         = 1e-06 [1/A^(2)]
+    * n_plates        = 20.0 
+    * caille          = 0.1 
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CLamellarPSModel.__init__, (self,)) 
+
+        CLamellarPSModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "LamellarPSModel"
+        ## Model description
+        self.description = """
+        [Concentrated Lamellar Form Factor] Calculates the scattered
+		intensity from a lyotropic lamellar phase.
+		The intensity (form factor and structure
+		factor)calculated is for lamellae of
+		uniform scattering length density that
+		are randomly distributed in solution
+		(a powder average). The lamellae thickness
+		is polydisperse. The model can also
+		be applied to large, multi-lamellar vesicles.
+		No resolution smeared version is included
+		in the structure factor of this model.
+		*Parameters: spacing = repeat spacing,
+		delta = bilayer thickness,
+		sld_bi = SLD_bilayer
+		sld_sol = SLD_solvent
+		n_plate = # of Lamellar plates
+		caille = Caille parameter (<0.8 or <1)
+		background = incoherent bgd
+		scale = scale factor
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['spacing'] = ['[A]', None, None]
+        self.details['delta'] = ['[A]', None, None]
+        self.details['sld_bi'] = ['[1/A^(2)]', None, None]
+        self.details['sld_sol'] = ['[1/A^(2)]', None, None]
+        self.details['n_plates'] = ['', None, None]
+        self.details['caille'] = ['', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['delta.width',
+                      'spacing.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_LamellarPSModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(LamellarPSModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLamellarPSModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLamellarPSModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CLamellarPSModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CLamellarPSModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CLamellarPSModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CLamellarPSModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/LinearPearlsModel.py
===================================================================
--- src/sans/models/LinearPearlsModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/LinearPearlsModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,206 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\linearpearls.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CLinearPearlsModel
+
+def create_LinearPearlsModel():
+    """
+       Create a model instance
+    """
+    obj = LinearPearlsModel()
+    # CLinearPearlsModel.__init__(obj) is called by
+    # the LinearPearlsModel constructor
+    return obj
+
+class LinearPearlsModel(CLinearPearlsModel, BaseComponent):
+    """ 
+    Class that evaluates a LinearPearlsModel model. 
+    This file was auto-generated from src\sans\models\include\linearpearls.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * radius          = 80.0 [A]
+    * edge_separation = 350.0 [A]
+    * num_pearls      = 3.0 
+    * sld_pearl       = 1e-06 [1/A^(2)]
+    * sld_solv        = 6.3e-06 [1/A^(2)]
+    * background      = 0.0 
+    * scale           = 1.0 
+    * radius          = 80.0 [A]
+    * edge_separation = 350.0 [A]
+    * num_pearls      = 3.0 
+    * sld_pearl       = 1e-06 [1/A^(2)]
+    * sld_solv        = 6.3e-06 [1/A^(2)]
+    * background      = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CLinearPearlsModel.__init__, (self,)) 
+
+        CLinearPearlsModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "LinearPearlsModel"
+        ## Model description
+        self.description = """
+        Calculate form factor for Pearl Necklace Model
+		[Macromol. 1996, 29, 2974-2979]
+		Parameters:
+		background:background
+		scale: scale factor
+		sld_pearl: the SLD of the pearl spheres
+		sld_solv: the SLD of the solvent
+		num_pearls: number of the pearls
+		radius: the radius of a pearl
+		edge_separation: the length of string segment; surface to surface
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['edge_separation'] = ['[A]', None, None]
+        self.details['num_pearls'] = ['', None, None]
+        self.details['sld_pearl'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['edge_separation'] = ['[A]', None, None]
+        self.details['num_pearls'] = ['', None, None]
+        self.details['sld_pearl'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius.width',
+                      'edge_separation.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_LinearPearlsModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(LinearPearlsModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLinearPearlsModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLinearPearlsModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CLinearPearlsModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CLinearPearlsModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CLinearPearlsModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CLinearPearlsModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/LogNormal.py
===================================================================
--- src/sans/models/LogNormal.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/LogNormal.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,174 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\logNormal.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CLogNormal
+
+def create_LogNormal():
+    """
+       Create a model instance
+    """
+    obj = LogNormal()
+    # CLogNormal.__init__(obj) is called by
+    # the LogNormal constructor
+    return obj
+
+class LogNormal(CLogNormal, BaseComponent):
+    """ 
+    Class that evaluates a LogNormal model. 
+    This file was auto-generated from src\sans\models\include\logNormal.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * sigma           = 1.0 
+    * center          = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CLogNormal.__init__, (self,)) 
+
+        CLogNormal.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "LogNormal"
+        ## Model description
+        self.description = """
+        f(x)=scale * 1/(sigma*math.sqrt(2pi))e^(-1/2*((math.log(x)-mu)/sigma)^2)
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['sigma'] = ['', None, None]
+        self.details['center'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_LogNormal, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(LogNormal())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLogNormal.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLogNormal.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CLogNormal.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CLogNormal.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CLogNormal.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CLogNormal.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/Lorentzian.py
===================================================================
--- src/sans/models/Lorentzian.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/Lorentzian.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,174 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\lorentzian.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CLorentzian
+
+def create_Lorentzian():
+    """
+       Create a model instance
+    """
+    obj = Lorentzian()
+    # CLorentzian.__init__(obj) is called by
+    # the Lorentzian constructor
+    return obj
+
+class Lorentzian(CLorentzian, BaseComponent):
+    """ 
+    Class that evaluates a Lorentzian model. 
+    This file was auto-generated from src\sans\models\include\lorentzian.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * gamma           = 1.0 
+    * center          = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CLorentzian.__init__, (self,)) 
+
+        CLorentzian.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "Lorentzian"
+        ## Model description
+        self.description = """
+        f(x)=scale * 1/pi 0.5gamma / [ (x-x_0)^2 + (0.5gamma)^2 ]
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['gamma'] = ['', None, None]
+        self.details['center'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_Lorentzian, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(Lorentzian())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLorentzian.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CLorentzian.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CLorentzian.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CLorentzian.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CLorentzian.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CLorentzian.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/MassFractalModel.py
===================================================================
--- src/sans/models/MassFractalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/MassFractalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,191 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\massfractal.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CMassFractalModel
+
+def create_MassFractalModel():
+    """
+       Create a model instance
+    """
+    obj = MassFractalModel()
+    # CMassFractalModel.__init__(obj) is called by
+    # the MassFractalModel constructor
+    return obj
+
+class MassFractalModel(CMassFractalModel, BaseComponent):
+    """ 
+    Class that evaluates a MassFractalModel model. 
+    This file was auto-generated from src\sans\models\include\massfractal.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * radius          = 10.0 [A]
+    * mass_dim        = 1.9 
+    * co_length       = 100.0 [A]
+    * background      = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CMassFractalModel.__init__, (self,)) 
+
+        CMassFractalModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "MassFractalModel"
+        ## Model description
+        self.description = """
+         The scattering intensity  I(x) = scale*P(x)*S(x) + background, where
+		scale = scale_factor  * V * delta^(2)
+		p(x)=  F(x*radius)^(2)
+		F(x) = 3*[sin(x)-x cos(x)]/x**3
+		S(x) = [(gamma(Dm-1)*colength^(Dm-1)*[1+(x^2*colength^2)]^((1-Dm)/2)
+		* sin[(Dm-1)*arctan(x*colength)])/x]
+		where delta = sldParticle -sldSolv.
+		radius       =  Particle radius
+		mass_dim  =  Mass fractal dimension
+		co_length  =  Cut-off length
+		background   =  background
+		Ref.:Mildner, Hall,J Phys D Appl Phys(1986), 9, 1535-1545
+		Note I: This model is valid for 1<mass_dim<6.
+		Note II: This model is not in absolute scale.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['mass_dim'] = ['', None, None]
+        self.details['co_length'] = ['[A]', None, None]
+        self.details['background'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_MassFractalModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(MassFractalModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CMassFractalModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CMassFractalModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CMassFractalModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CMassFractalModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CMassFractalModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CMassFractalModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/MassSurfaceFractal.py
===================================================================
--- src/sans/models/MassSurfaceFractal.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/MassSurfaceFractal.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,192 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\masssurfacefractal.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CMassSurfaceFractal
+
+def create_MassSurfaceFractal():
+    """
+       Create a model instance
+    """
+    obj = MassSurfaceFractal()
+    # CMassSurfaceFractal.__init__(obj) is called by
+    # the MassSurfaceFractal constructor
+    return obj
+
+class MassSurfaceFractal(CMassSurfaceFractal, BaseComponent):
+    """ 
+    Class that evaluates a MassSurfaceFractal model. 
+    This file was auto-generated from src\sans\models\include\masssurfacefractal.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * mass_dim        = 1.8 
+    * surface_dim     = 2.3 
+    * cluster_rg      = 86.7 [A]
+    * primary_rg      = 4000.0 [A]
+    * background      = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CMassSurfaceFractal.__init__, (self,)) 
+
+        CMassSurfaceFractal.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "MassSurfaceFractal"
+        ## Model description
+        self.description = """
+         The scattering intensity  I(x) = scale*P(x) + background,
+		p(x)= {[1+(x^2*a)]^(Dm/2) * [1+(x^2*b)]^(6-Ds-Dm)/2}^(-1)
+		a = Rg^2/(3*Dm/2)
+		b = rg^2/(3*(6-Ds-Dm)/2)
+		scale        =  scale factor * N*Volume^2*contrast^2
+		mass_dim       =  Dm (mass fractal dimension)
+		surface_dim  =  Ds
+		cluster_rg  =  Rg
+		primary_rg    =  rg
+		background   =  background
+		Ref: Schmidt, J Appl Cryst, eq(19), (1991), 24, 414-435
+		: Hurd, Schaefer, Martin, Phys Rev A, eq(2),(1987),35, 2361-2364
+		Note that 0 < Ds< 6 and 0 < Dm < 6.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['mass_dim'] = ['', None, None]
+        self.details['surface_dim'] = ['', None, None]
+        self.details['cluster_rg'] = ['[A]', None, None]
+        self.details['primary_rg'] = ['[A]', None, None]
+        self.details['background'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_MassSurfaceFractal, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(MassSurfaceFractal())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CMassSurfaceFractal.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CMassSurfaceFractal.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CMassSurfaceFractal.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CMassSurfaceFractal.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CMassSurfaceFractal.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CMassSurfaceFractal.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/MicelleSphCoreModel.py
===================================================================
--- src/sans/models/MicelleSphCoreModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/MicelleSphCoreModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,206 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\micelleSphCore.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CMicelleSphCoreModel
+
+def create_MicelleSphCoreModel():
+    """
+       Create a model instance
+    """
+    obj = MicelleSphCoreModel()
+    # CMicelleSphCoreModel.__init__(obj) is called by
+    # the MicelleSphCoreModel constructor
+    return obj
+
+class MicelleSphCoreModel(CMicelleSphCoreModel, BaseComponent):
+    """ 
+    Class that evaluates a MicelleSphCoreModel model. 
+    This file was auto-generated from src\sans\models\include\micelleSphCore.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * ndensity        = 8.94e+15 [1/cm^(3)]
+    * v_core          = 62624.0 [A^3]
+    * v_corona        = 61940.0 [A^(3)]
+    * rho_solv        = 6.4e-06 [1/A^(2)]
+    * rho_core        = 3.4e-07 [1/A^(2)]
+    * rho_corona      = 8e-07 [1/A^(2)]
+    * radius_core     = 45.0 [A]
+    * radius_gyr      = 20.0 [A]
+    * d_penetration   = 1.0 
+    * n_aggreg        = 6.0 
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CMicelleSphCoreModel.__init__, (self,)) 
+
+        CMicelleSphCoreModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "MicelleSphCoreModel"
+        ## Model description
+        self.description = """
+        
+		Model parameters:
+		ndensity : number density of micelles
+		v_core: volume block in core
+		v_corona: volume block in corona
+		rho_solv: sld of solvent
+		rho_core: sld of core
+		rho_corona: sld of corona
+		radius_core: radius of core
+		radius_gyr: radius of gyration of chains in corona
+		d_penetration: close to unity, mimics non-penetration of gaussian chains
+		n_aggreg: aggregation number of the micelle
+		background: incoherent background
+		scale : scale factor
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['ndensity'] = ['[1/cm^(3)]', None, None]
+        self.details['v_core'] = ['[A^3]', None, None]
+        self.details['v_corona'] = ['[A^(3)]', None, None]
+        self.details['rho_solv'] = ['[1/A^(2)]', None, None]
+        self.details['rho_core'] = ['[1/A^(2)]', None, None]
+        self.details['rho_corona'] = ['[1/A^(2)]', None, None]
+        self.details['radius_core'] = ['[A]', None, None]
+        self.details['radius_gyr'] = ['[A]', None, None]
+        self.details['d_penetration'] = ['', None, None]
+        self.details['n_aggreg'] = ['', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius_core.width',
+                      'radius_gyr.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_MicelleSphCoreModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(MicelleSphCoreModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CMicelleSphCoreModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CMicelleSphCoreModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CMicelleSphCoreModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CMicelleSphCoreModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CMicelleSphCoreModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CMicelleSphCoreModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/MultiShellModel.py
===================================================================
--- src/sans/models/MultiShellModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/MultiShellModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,194 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\multishell.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CMultiShellModel
+
+def create_MultiShellModel():
+    """
+       Create a model instance
+    """
+    obj = MultiShellModel()
+    # CMultiShellModel.__init__(obj) is called by
+    # the MultiShellModel constructor
+    return obj
+
+class MultiShellModel(CMultiShellModel, BaseComponent):
+    """ 
+    Class that evaluates a MultiShellModel model. 
+    This file was auto-generated from src\sans\models\include\multishell.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * core_radius     = 60.0 [A]
+    * s_thickness     = 10.0 [A]
+    * w_thickness     = 10.0 [A]
+    * core_sld        = 6.4e-06 [1/A^(2)]
+    * shell_sld       = 4e-07 [1/A^(2)]
+    * n_pairs         = 2.0 
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CMultiShellModel.__init__, (self,)) 
+
+        CMultiShellModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "MultiShellModel"
+        ## Model description
+        self.description = """
+         MultiShell (Sphere) Model (or Multilamellar Vesicles): Model parameters;
+		scale : scale factor
+		core_radius : Core radius of the multishell
+		s_thickness: shell thickness
+		w_thickness: water thickness
+		core_sld: core scattering length density
+		shell_sld: shell scattering length density
+		n_pairs:number of pairs of water/shell
+		background: incoherent background
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['core_radius'] = ['[A]', None, None]
+        self.details['s_thickness'] = ['[A]', None, None]
+        self.details['w_thickness'] = ['[A]', None, None]
+        self.details['core_sld'] = ['[1/A^(2)]', None, None]
+        self.details['shell_sld'] = ['[1/A^(2)]', None, None]
+        self.details['n_pairs'] = ['', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['core_radius.width',
+                      's_thickness.width',
+                      'w_thickness.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_MultiShellModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(MultiShellModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CMultiShellModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CMultiShellModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CMultiShellModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CMultiShellModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CMultiShellModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CMultiShellModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/OnionModel.py
===================================================================
--- src/sans/models/OnionModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/OnionModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,312 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\onion.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import COnionModel
+
+def create_OnionModel():
+    """
+       Create a model instance
+    """
+    obj = OnionModel()
+    # COnionModel.__init__(obj) is called by
+    # the OnionModel constructor
+    return obj
+
+class OnionModel(COnionModel, BaseComponent):
+    """ 
+    Class that evaluates a OnionModel model. 
+    This file was auto-generated from src\sans\models\include\onion.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * n_shells        = 1.0 
+    * scale           = 1.0 
+    * rad_core0       = 200.0 [A]
+    * sld_core0       = 1e-06 [1/A^(2)]
+    * sld_solv        = 6.4e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * sld_out_shell1  = 2e-06 [1/A^(2)]
+    * sld_out_shell2  = 2.5e-06 [1/A^(2)]
+    * sld_out_shell3  = 3e-06 [1/A^(2)]
+    * sld_out_shell4  = 3.5e-06 [1/A^(2)]
+    * sld_out_shell5  = 4e-06 [1/A^(2)]
+    * sld_out_shell6  = 4.5e-06 [1/A^(2)]
+    * sld_out_shell7  = 5e-06 [1/A^(2)]
+    * sld_out_shell8  = 5.5e-06 [1/A^(2)]
+    * sld_out_shell9  = 6e-06 [1/A^(2)]
+    * sld_out_shell10 = 6.2e-06 [1/A^(2)]
+    * sld_in_shell1   = 1.7e-06 [1/A^(2)]
+    * sld_in_shell2   = 2.2e-06 [1/A^(2)]
+    * sld_in_shell3   = 2.7e-06 [1/A^(2)]
+    * sld_in_shell4   = 3.2e-06 [1/A^(2)]
+    * sld_in_shell5   = 3.7e-06 [1/A^(2)]
+    * sld_in_shell6   = 4.2e-06 [1/A^(2)]
+    * sld_in_shell7   = 4.7e-06 [1/A^(2)]
+    * sld_in_shell8   = 5.2e-06 [1/A^(2)]
+    * sld_in_shell9   = 5.7e-06 [1/A^(2)]
+    * sld_in_shell10  = 6e-06 [1/A^(2)]
+    * A_shell1        = 1.0 
+    * A_shell2        = 1.0 
+    * A_shell3        = 1.0 
+    * A_shell4        = 1.0 
+    * A_shell5        = 1.0 
+    * A_shell6        = 1.0 
+    * A_shell7        = 1.0 
+    * A_shell8        = 1.0 
+    * A_shell9        = 1.0 
+    * A_shell10       = 1.0 
+    * thick_shell1    = 50.0 [A]
+    * thick_shell2    = 50.0 [A]
+    * thick_shell3    = 50.0 [A]
+    * thick_shell4    = 50.0 [A]
+    * thick_shell5    = 50.0 [A]
+    * thick_shell6    = 50.0 [A]
+    * thick_shell7    = 50.0 [A]
+    * thick_shell8    = 50.0 [A]
+    * thick_shell9    = 50.0 [A]
+    * thick_shell10   = 50.0 [A]
+    * func_shell1     = 2.0 
+    * func_shell2     = 2.0 
+    * func_shell3     = 2.0 
+    * func_shell4     = 2.0 
+    * func_shell5     = 2.0 
+    * func_shell6     = 2.0 
+    * func_shell7     = 2.0 
+    * func_shell8     = 2.0 
+    * func_shell9     = 2.0 
+    * func_shell10    = 2.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(COnionModel.__init__, (self,)) 
+
+        COnionModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "OnionModel"
+        ## Model description
+        self.description = """
+        Form factor of mutishells normalized by the volume. Here each shell is described
+		by an exponential function;
+		I)
+		For A_shell != 0,
+		f(r) = B*exp(A_shell*(r-r_in)/thick_shell)+C
+		where
+		B=(sld_out-sld_in)/(exp(A_shell)-1)
+		C=sld_in-B.
+		Note that in the above case,
+		the function becomes a linear function
+		as A_shell --> 0+ or 0-.
+		II)
+		For the exact point of A_shell == 0,
+		f(r) = sld_in ,i.e., it crosses over flat function
+		Note that the 'sld_out' becaomes NULL in this case.
+		
+		background:background,
+		rad_core0: radius of sphere(core)
+		thick_shell#:the thickness of the shell#
+		sld_core0: the SLD of the sphere
+		sld_solv: the SLD of the solvent
+		sld_shell: the SLD of the shell#
+		A_shell#: the coefficient in the exponential function
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['n_shells'] = ['', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['rad_core0'] = ['[A]', None, None]
+        self.details['sld_core0'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['sld_out_shell1'] = ['[1/A^(2)]', None, None]
+        self.details['sld_out_shell2'] = ['[1/A^(2)]', None, None]
+        self.details['sld_out_shell3'] = ['[1/A^(2)]', None, None]
+        self.details['sld_out_shell4'] = ['[1/A^(2)]', None, None]
+        self.details['sld_out_shell5'] = ['[1/A^(2)]', None, None]
+        self.details['sld_out_shell6'] = ['[1/A^(2)]', None, None]
+        self.details['sld_out_shell7'] = ['[1/A^(2)]', None, None]
+        self.details['sld_out_shell8'] = ['[1/A^(2)]', None, None]
+        self.details['sld_out_shell9'] = ['[1/A^(2)]', None, None]
+        self.details['sld_out_shell10'] = ['[1/A^(2)]', None, None]
+        self.details['sld_in_shell1'] = ['[1/A^(2)]', None, None]
+        self.details['sld_in_shell2'] = ['[1/A^(2)]', None, None]
+        self.details['sld_in_shell3'] = ['[1/A^(2)]', None, None]
+        self.details['sld_in_shell4'] = ['[1/A^(2)]', None, None]
+        self.details['sld_in_shell5'] = ['[1/A^(2)]', None, None]
+        self.details['sld_in_shell6'] = ['[1/A^(2)]', None, None]
+        self.details['sld_in_shell7'] = ['[1/A^(2)]', None, None]
+        self.details['sld_in_shell8'] = ['[1/A^(2)]', None, None]
+        self.details['sld_in_shell9'] = ['[1/A^(2)]', None, None]
+        self.details['sld_in_shell10'] = ['[1/A^(2)]', None, None]
+        self.details['A_shell1'] = ['', None, None]
+        self.details['A_shell2'] = ['', None, None]
+        self.details['A_shell3'] = ['', None, None]
+        self.details['A_shell4'] = ['', None, None]
+        self.details['A_shell5'] = ['', None, None]
+        self.details['A_shell6'] = ['', None, None]
+        self.details['A_shell7'] = ['', None, None]
+        self.details['A_shell8'] = ['', None, None]
+        self.details['A_shell9'] = ['', None, None]
+        self.details['A_shell10'] = ['', None, None]
+        self.details['thick_shell1'] = ['[A]', None, None]
+        self.details['thick_shell2'] = ['[A]', None, None]
+        self.details['thick_shell3'] = ['[A]', None, None]
+        self.details['thick_shell4'] = ['[A]', None, None]
+        self.details['thick_shell5'] = ['[A]', None, None]
+        self.details['thick_shell6'] = ['[A]', None, None]
+        self.details['thick_shell7'] = ['[A]', None, None]
+        self.details['thick_shell8'] = ['[A]', None, None]
+        self.details['thick_shell9'] = ['[A]', None, None]
+        self.details['thick_shell10'] = ['[A]', None, None]
+        self.details['func_shell1'] = ['', None, None]
+        self.details['func_shell2'] = ['', None, None]
+        self.details['func_shell3'] = ['', None, None]
+        self.details['func_shell4'] = ['', None, None]
+        self.details['func_shell5'] = ['', None, None]
+        self.details['func_shell6'] = ['', None, None]
+        self.details['func_shell7'] = ['', None, None]
+        self.details['func_shell8'] = ['', None, None]
+        self.details['func_shell9'] = ['', None, None]
+        self.details['func_shell10'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = ['rad_core0.width',
+                      'thick_shell1.width',
+                      'thick_shell2.width',
+                      'thick_shell3.width',
+                      'thick_shell4.width',
+                      'thick_shell5.width',
+                      'thick_shell6.width',
+                      'thick_shell7.width',
+                      'thick_shell8.width',
+                      'thick_shell9.width',
+                      'thick_shell10.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_OnionModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(OnionModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return COnionModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return COnionModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return COnionModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return COnionModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return COnionModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return COnionModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/ParallelepipedModel.py
===================================================================
--- src/sans/models/ParallelepipedModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/ParallelepipedModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,233 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\parallelepiped.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CParallelepipedModel
+
+def create_ParallelepipedModel():
+    """
+       Create a model instance
+    """
+    obj = ParallelepipedModel()
+    # CParallelepipedModel.__init__(obj) is called by
+    # the ParallelepipedModel constructor
+    return obj
+
+class ParallelepipedModel(CParallelepipedModel, BaseComponent):
+    """ 
+    Class that evaluates a ParallelepipedModel model. 
+    This file was auto-generated from src\sans\models\include\parallelepiped.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * short_a         = 35.0 [A]
+    * short_b         = 75.0 [A]
+    * long_c          = 400.0 [A]
+    * sldPipe         = 6.3e-06 [1/A^(2)]
+    * sldSolv         = 1e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * parallel_theta  = 0.0 [deg]
+    * parallel_phi    = 0.0 [deg]
+    * parallel_psi    = 0.0 [deg]
+    * M0_sld_pipe     = 0.0 [1/A^(2)]
+    * M_theta_pipe    = 0.0 [deg]
+    * M_phi_pipe      = 0.0 [deg]
+    * M0_sld_solv     = 0.0 [1/A^(2)]
+    * M_theta_solv    = 0.0 [deg]
+    * M_phi_solv      = 0.0 [deg]
+    * Up_frac_i       = 0.5 [u/(u+d)]
+    * Up_frac_f       = 0.5 [u/(u+d)]
+    * Up_theta        = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CParallelepipedModel.__init__, (self,)) 
+
+        CParallelepipedModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "ParallelepipedModel"
+        ## Model description
+        self.description = """
+         Form factor for a rectangular solid with uniform scattering length density.
+		
+		scale:Scale factor
+		short_a: length of short edge  [A]
+		short_b: length of another short edge [A]
+		long_c: length of long edge  of the parallelepiped [A]
+		sldPipe: Pipe_sld
+		sldSolv: solvent_sld
+		background:Incoherent Background [1/cm]
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['short_a'] = ['[A]', None, None]
+        self.details['short_b'] = ['[A]', None, None]
+        self.details['long_c'] = ['[A]', None, None]
+        self.details['sldPipe'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['parallel_theta'] = ['[deg]', None, None]
+        self.details['parallel_phi'] = ['[deg]', None, None]
+        self.details['parallel_psi'] = ['[deg]', None, None]
+        self.details['M0_sld_pipe'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_pipe'] = ['[deg]', None, None]
+        self.details['M_phi_pipe'] = ['[deg]', None, None]
+        self.details['M0_sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_solv'] = ['[deg]', None, None]
+        self.details['M_phi_solv'] = ['[deg]', None, None]
+        self.details['Up_frac_i'] = ['[u/(u+d)]', None, None]
+        self.details['Up_frac_f'] = ['[u/(u+d)]', None, None]
+        self.details['Up_theta'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['short_a.width',
+                      'short_b.width',
+                      'long_c.width',
+                      'parallel_phi.width',
+                      'parallel_psi.width',
+                      'parallel_theta.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['parallel_phi',
+                                   'parallel_psi',
+                                   'parallel_theta',
+                                   'parallel_phi.width',
+                                   'parallel_psi.width',
+                                   'parallel_theta.width',
+                                   'M0_sld_pipe',
+                                   'M_theta_pipe',
+                                   'M_phi_pipe',
+                                   'M0_sld_solv',
+                                   'M_theta_solv',
+                                   'M_phi_solv',
+                                   'Up_frac_i',
+                                   'Up_frac_f',
+                                   'Up_theta']
+
+        ## parameters with magnetism
+        self.magnetic_params = ['M0_sld_pipe', 'M_theta_pipe', 'M_phi_pipe', 'M0_sld_solv', 'M_theta_solv', 'M_phi_solv', 'Up_frac_i', 'Up_frac_f', 'Up_theta']
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_ParallelepipedModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(ParallelepipedModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CParallelepipedModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CParallelepipedModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CParallelepipedModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CParallelepipedModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CParallelepipedModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CParallelepipedModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/PearlNecklaceModel.py
===================================================================
--- src/sans/models/PearlNecklaceModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/PearlNecklaceModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,216 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\pearlnecklace.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CPearlNecklaceModel
+
+def create_PearlNecklaceModel():
+    """
+       Create a model instance
+    """
+    obj = PearlNecklaceModel()
+    # CPearlNecklaceModel.__init__(obj) is called by
+    # the PearlNecklaceModel constructor
+    return obj
+
+class PearlNecklaceModel(CPearlNecklaceModel, BaseComponent):
+    """ 
+    Class that evaluates a PearlNecklaceModel model. 
+    This file was auto-generated from src\sans\models\include\pearlnecklace.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * radius          = 80.0 [A]
+    * edge_separation = 350.0 [A]
+    * thick_string    = 2.5 [A]
+    * num_pearls      = 3.0 
+    * sld_pearl       = 1e-06 [1/A^(2)]
+    * sld_string      = 1e-06 [1/A^(2)]
+    * sld_solv        = 6.3e-06 [1/A^(2)]
+    * background      = 0.0 
+    * scale           = 1.0 
+    * radius          = 80.0 [A]
+    * edge_separation = 350.0 [A]
+    * thick_string    = 2.5 [A]
+    * num_pearls      = 3.0 
+    * sld_pearl       = 1e-06 [1/A^(2)]
+    * sld_string      = 1e-06 [1/A^(2)]
+    * sld_solv        = 6.3e-06 [1/A^(2)]
+    * background      = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CPearlNecklaceModel.__init__, (self,)) 
+
+        CPearlNecklaceModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "PearlNecklaceModel"
+        ## Model description
+        self.description = """
+        Calculate form factor for Pearl Necklace Model
+		[Macromol. Symp. 2004, 211, 25-42]
+		Parameters:
+		background:background
+		scale: scale factor
+		sld_pearl: the SLD of the pearl spheres
+		sld_string: the SLD of the strings
+		sld_solv: the SLD of the solvent
+		num_pearls: number of the pearls
+		radius: the radius of a pearl
+		edge_separation: the length of string segment; surface to surface
+		thick_string: thickness (ie, diameter) of the string
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['edge_separation'] = ['[A]', None, None]
+        self.details['thick_string'] = ['[A]', None, None]
+        self.details['num_pearls'] = ['', None, None]
+        self.details['sld_pearl'] = ['[1/A^(2)]', None, None]
+        self.details['sld_string'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['edge_separation'] = ['[A]', None, None]
+        self.details['thick_string'] = ['[A]', None, None]
+        self.details['num_pearls'] = ['', None, None]
+        self.details['sld_pearl'] = ['[1/A^(2)]', None, None]
+        self.details['sld_string'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius.width',
+                      'edge_separation.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_PearlNecklaceModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(PearlNecklaceModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CPearlNecklaceModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CPearlNecklaceModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CPearlNecklaceModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CPearlNecklaceModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CPearlNecklaceModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CPearlNecklaceModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/Poly_GaussCoil.py
===================================================================
--- src/sans/models/Poly_GaussCoil.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/Poly_GaussCoil.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,183 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\polygausscoil.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CPoly_GaussCoil
+
+def create_Poly_GaussCoil():
+    """
+       Create a model instance
+    """
+    obj = Poly_GaussCoil()
+    # CPoly_GaussCoil.__init__(obj) is called by
+    # the Poly_GaussCoil constructor
+    return obj
+
+class Poly_GaussCoil(CPoly_GaussCoil, BaseComponent):
+    """ 
+    Class that evaluates a Poly_GaussCoil model. 
+    This file was auto-generated from src\sans\models\include\polygausscoil.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * rg              = 60.0 [A]
+    * scale           = 1.0 
+    * poly_m          = 2.0 [Mw/Mn]
+    * background      = 0.001 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CPoly_GaussCoil.__init__, (self,)) 
+
+        CPoly_GaussCoil.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "Poly_GaussCoil"
+        ## Model description
+        self.description = """
+        I(q)=(scale)*2*[(1+U*x)^(-1/U)+x-1]/[(1+U)*x^2] + background
+		where x = [rg^2*q^2]
+		and the polydispersity is
+		U = [M_w/M_n]-1.
+		scale = scale factor * volume fraction
+		rg = radius of gyration
+		poly_m = polydispersity of molecular weight
+		background = incoherent background
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['rg'] = ['[A]', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['poly_m'] = ['[Mw/Mn]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_Poly_GaussCoil, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(Poly_GaussCoil())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CPoly_GaussCoil.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CPoly_GaussCoil.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CPoly_GaussCoil.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CPoly_GaussCoil.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CPoly_GaussCoil.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CPoly_GaussCoil.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/PringlesModel.py
===================================================================
--- src/sans/models/PringlesModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/PringlesModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,187 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\pringles.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CPringlesModel
+
+def create_PringlesModel():
+    """
+       Create a model instance
+    """
+    obj = PringlesModel()
+    # CPringlesModel.__init__(obj) is called by
+    # the PringlesModel constructor
+    return obj
+
+class PringlesModel(CPringlesModel, BaseComponent):
+    """ 
+    Class that evaluates a PringlesModel model. 
+    This file was auto-generated from src\sans\models\include\pringles.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * radius          = 60.0 [A]
+    * thickness       = 10.0 [A]
+    * alpha           = 0.001 [rad]
+    * beta            = 0.02 [rad]
+    * sld_pringle     = 1e-06 [A^(-2)]
+    * sld_solvent     = 6.35e-06 [A^(-2)]
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CPringlesModel.__init__, (self,)) 
+
+        CPringlesModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "PringlesModel"
+        ## Model description
+        self.description = """
+         Pringles model for K Edler. Represents a disc that is bent in two directions. 
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['thickness'] = ['[A]', None, None]
+        self.details['alpha'] = ['[rad]', None, None]
+        self.details['beta'] = ['[rad]', None, None]
+        self.details['sld_pringle'] = ['[A^(-2)]', None, None]
+        self.details['sld_solvent'] = ['[A^(-2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius.width',
+                      'thickness.width',
+                      'alpha.width',
+                      'beta.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_PringlesModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(PringlesModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CPringlesModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CPringlesModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CPringlesModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CPringlesModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CPringlesModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CPringlesModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/RPAModel.py
===================================================================
--- src/sans/models/RPAModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/RPAModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,258 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\rpa.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CRPAModel
+
+def create_RPAModel():
+    """
+       Create a model instance
+    """
+    obj = RPAModel()
+    # CRPAModel.__init__(obj) is called by
+    # the RPAModel constructor
+    return obj
+
+class RPAModel(CRPAModel, BaseComponent):
+    """ 
+    Class that evaluates a RPAModel model. 
+    This file was auto-generated from src\sans\models\include\rpa.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * lcase_n         = 0.0 
+    * ba              = 5.0 
+    * bb              = 5.0 
+    * bc              = 5.0 
+    * bd              = 5.0 
+    * Kab             = -0.0004 
+    * Kac             = -0.0004 
+    * Kad             = -0.0004 
+    * Kbc             = -0.0004 
+    * Kbd             = -0.0004 
+    * Kcd             = -0.0004 
+    * scale           = 1.0 
+    * background      = 0.0 [1/cm]
+    * Na              = 1000.0 
+    * Phia            = 0.25 
+    * va              = 100.0 
+    * La              = 1e-12 
+    * Nb              = 1000.0 
+    * Phib            = 0.25 
+    * vb              = 100.0 
+    * Lb              = 1e-12 
+    * Nc              = 1000.0 
+    * Phic            = 0.25 
+    * vc              = 100.0 
+    * Lc              = 1e-12 
+    * Nd              = 1000.0 
+    * Phid            = 0.25 
+    * vd              = 100.0 
+    * Ld              = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CRPAModel.__init__, (self,)) 
+
+        CRPAModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "RPAModel"
+        ## Model description
+        self.description = """
+          THIS FORMALISM APPLIES TO MULTICOMPONENT POLYMER MIXTURES IN THE
+		HOMOGENEOUS (MIXED) PHASE REGION ONLY.;
+		CASE 0: C/D BINARY MIXTURE OF HOMOPOLYMERS
+		CASE 1: C-D DIBLOCK COPOLYMER
+		CASE 2: B/C/D TERNARY MIXTURE OF HOMOPOLYMERS
+		CASE 3: B/C-D MIXTURE OF HOMOPOLYMER B AND
+		DIBLOCK COPOLYMER C-D
+		CASE 4: B-C-D TRIBLOCK COPOLYMER
+		CASE 5: A/B/C/D QUATERNARY MIXTURE OF HOMOPOLYMERS
+		CASE 6: A/B/C-D MIXTURE OF TWO HOMOPOLYMERS A/B
+		AND A DIBLOCK C-D
+		CASE 7: A/B-C-D MIXTURE OF A HOMOPOLYMER A AND A
+		TRIBLOCK B-C-D
+		CASE 8: A-B/C-D MIXTURE OF TWO DIBLOCK COPOLYMERS
+		A-B AND C-D
+		CASE 9: A-B-C-D FOUR-BLOCK COPOLYMER
+		See details in the model function help
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['lcase_n'] = ['', None, None]
+        self.details['ba'] = ['', None, None]
+        self.details['bb'] = ['', None, None]
+        self.details['bc'] = ['', None, None]
+        self.details['bd'] = ['', None, None]
+        self.details['Kab'] = ['', None, None]
+        self.details['Kac'] = ['', None, None]
+        self.details['Kad'] = ['', None, None]
+        self.details['Kbc'] = ['', None, None]
+        self.details['Kbd'] = ['', None, None]
+        self.details['Kcd'] = ['', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['Na'] = ['', None, None]
+        self.details['Phia'] = ['', None, None]
+        self.details['va'] = ['', None, None]
+        self.details['La'] = ['', None, None]
+        self.details['Nb'] = ['', None, None]
+        self.details['Phib'] = ['', None, None]
+        self.details['vb'] = ['', None, None]
+        self.details['Lb'] = ['', None, None]
+        self.details['Nc'] = ['', None, None]
+        self.details['Phic'] = ['', None, None]
+        self.details['vc'] = ['', None, None]
+        self.details['Lc'] = ['', None, None]
+        self.details['Nd'] = ['', None, None]
+        self.details['Phid'] = ['', None, None]
+        self.details['vd'] = ['', None, None]
+        self.details['Ld'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = ['lcase_n',
+                             'Na',
+                             'Phia',
+                             'va',
+                             'La',
+                             'Nb',
+                             'Phib',
+                             'vb',
+                             'Lb',
+                             'Nc',
+                             'Phic',
+                             'vc',
+                             'Lc',
+                             'Nd',
+                             'Phid',
+                             'vd',
+                             'Ld']
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_RPAModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(RPAModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CRPAModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CRPAModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CRPAModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CRPAModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CRPAModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CRPAModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/RaspBerryModel.py
===================================================================
--- src/sans/models/RaspBerryModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/RaspBerryModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,199 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\raspberry.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CRaspBerryModel
+
+def create_RaspBerryModel():
+    """
+       Create a model instance
+    """
+    obj = RaspBerryModel()
+    # CRaspBerryModel.__init__(obj) is called by
+    # the RaspBerryModel constructor
+    return obj
+
+class RaspBerryModel(CRaspBerryModel, BaseComponent):
+    """ 
+    Class that evaluates a RaspBerryModel model. 
+    This file was auto-generated from src\sans\models\include\raspberry.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * volf_Lsph       = 0.05 
+    * radius_Lsph     = 5000.0 [A]
+    * sld_Lsph        = -4e-07 [1/A^(2)]
+    * volf_Ssph       = 0.005 
+    * radius_Ssph     = 100.0 [A]
+    * surfrac_Ssph    = 0.4 
+    * sld_Ssph        = 3.5e-06 [1/A^(2)]
+    * delta_Ssph      = 0.0 
+    * sld_solv        = 6.3e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CRaspBerryModel.__init__, (self,)) 
+
+        CRaspBerryModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "RaspBerryModel"
+        ## Model description
+        self.description = """
+         RaspBerryModel:
+		volf_Lsph = volume fraction large spheres
+		radius_Lsph = radius large sphere (A)
+		sld_Lsph = sld large sphere (A-2)
+		volf_Ssph = volume fraction small spheres
+		radius_Ssph = radius small sphere (A)
+		surfrac_Ssph = fraction of small spheres at surface
+		sld_Ssph = sld small sphere
+		delta_Ssph = small sphere penetration (A)
+		sld_solv   = sld solvent
+		background = background (cm-1)
+		Ref: J. coll. inter. sci. (2010) vol. 343 (1) pp. 36-41.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['volf_Lsph'] = ['', None, None]
+        self.details['radius_Lsph'] = ['[A]', None, None]
+        self.details['sld_Lsph'] = ['[1/A^(2)]', None, None]
+        self.details['volf_Ssph'] = ['', None, None]
+        self.details['radius_Ssph'] = ['[A]', None, None]
+        self.details['surfrac_Ssph'] = ['', None, None]
+        self.details['sld_Ssph'] = ['[1/A^(2)]', None, None]
+        self.details['delta_Ssph'] = ['', None, None]
+        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius_Lsph.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_RaspBerryModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(RaspBerryModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CRaspBerryModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CRaspBerryModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CRaspBerryModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CRaspBerryModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CRaspBerryModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CRaspBerryModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/RectangularHollowPrismInfThinWallsModel.py
===================================================================
--- src/sans/models/RectangularHollowPrismInfThinWallsModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/RectangularHollowPrismInfThinWallsModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,191 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\RectangularHollowPrismInfThinWalls.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CRectangularHollowPrismInfThinWallsModel
+
+def create_RectangularHollowPrismInfThinWallsModel():
+    """
+       Create a model instance
+    """
+    obj = RectangularHollowPrismInfThinWallsModel()
+    # CRectangularHollowPrismInfThinWallsModel.__init__(obj) is called by
+    # the RectangularHollowPrismInfThinWallsModel constructor
+    return obj
+
+class RectangularHollowPrismInfThinWallsModel(CRectangularHollowPrismInfThinWallsModel, BaseComponent):
+    """ 
+    Class that evaluates a RectangularHollowPrismInfThinWallsModel model. 
+    This file was auto-generated from src\sans\models\include\RectangularHollowPrismInfThinWalls.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * short_side      = 35.0 [A]
+    * b2a_ratio       = 1.0 [adim]
+    * c2a_ratio       = 1.0 [adim]
+    * sldPipe         = 6.3e-06 [1/A^(2)]
+    * sldSolv         = 1e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CRectangularHollowPrismInfThinWallsModel.__init__, (self,)) 
+
+        CRectangularHollowPrismInfThinWallsModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "RectangularHollowPrismInfThinWallsModel"
+        ## Model description
+        self.description = """
+         Form factor for a hollow rectangular prism with uniform scattering length density and infinitely thin walls.
+		scale:Scale factor
+		short_side: shortest side of the rectangular prism  [A]
+		b2a_ratio: ratio b/a [adim]
+		c2a_ratio: ratio c/a [adim]
+		sldPipe: Pipe_sld
+		sldSolv: solvent_sld
+		background:Incoherent Background [1/cm]
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['short_side'] = ['[A]', None, None]
+        self.details['b2a_ratio'] = ['[adim]', None, None]
+        self.details['c2a_ratio'] = ['[adim]', None, None]
+        self.details['sldPipe'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['short_side.width',
+                      'b2a_ratio.width',
+                      'c2a_ratio.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_RectangularHollowPrismInfThinWallsModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(RectangularHollowPrismInfThinWallsModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CRectangularHollowPrismInfThinWallsModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CRectangularHollowPrismInfThinWallsModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CRectangularHollowPrismInfThinWallsModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CRectangularHollowPrismInfThinWallsModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CRectangularHollowPrismInfThinWallsModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CRectangularHollowPrismInfThinWallsModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/RectangularHollowPrismModel.py
===================================================================
--- src/sans/models/RectangularHollowPrismModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/RectangularHollowPrismModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,195 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\RectangularHollowPrism.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CRectangularHollowPrismModel
+
+def create_RectangularHollowPrismModel():
+    """
+       Create a model instance
+    """
+    obj = RectangularHollowPrismModel()
+    # CRectangularHollowPrismModel.__init__(obj) is called by
+    # the RectangularHollowPrismModel constructor
+    return obj
+
+class RectangularHollowPrismModel(CRectangularHollowPrismModel, BaseComponent):
+    """ 
+    Class that evaluates a RectangularHollowPrismModel model. 
+    This file was auto-generated from src\sans\models\include\RectangularHollowPrism.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * short_side      = 35.0 [A]
+    * b2a_ratio       = 1.0 [adim]
+    * c2a_ratio       = 1.0 [adim]
+    * thickness       = 1.0 [A]
+    * sldPipe         = 6.3e-06 [1/A^(2)]
+    * sldSolv         = 1e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CRectangularHollowPrismModel.__init__, (self,)) 
+
+        CRectangularHollowPrismModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "RectangularHollowPrismModel"
+        ## Model description
+        self.description = """
+         Form factor for a hollow rectangular prism with uniform scattering length density.
+		scale:Scale factor
+		short_side: shortest side of the rectangular prism  [A]
+		b2a_ratio: ratio b/a [adim]
+		c2a_ratio: ratio c/a [adim]
+		thickness: thickness of the walls [A]
+		sldPipe: Pipe_sld
+		sldSolv: solvent_sld
+		background:Incoherent Background [1/cm]
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['short_side'] = ['[A]', None, None]
+        self.details['b2a_ratio'] = ['[adim]', None, None]
+        self.details['c2a_ratio'] = ['[adim]', None, None]
+        self.details['thickness'] = ['[A]', None, None]
+        self.details['sldPipe'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['short_side.width',
+                      'b2a_ratio.width',
+                      'c2a_ratio.width',
+                      'thicness.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_RectangularHollowPrismModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(RectangularHollowPrismModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CRectangularHollowPrismModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CRectangularHollowPrismModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CRectangularHollowPrismModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CRectangularHollowPrismModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CRectangularHollowPrismModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CRectangularHollowPrismModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/RectangularPrismModel.py
===================================================================
--- src/sans/models/RectangularPrismModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/RectangularPrismModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,191 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\RectangularPrism.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CRectangularPrismModel
+
+def create_RectangularPrismModel():
+    """
+       Create a model instance
+    """
+    obj = RectangularPrismModel()
+    # CRectangularPrismModel.__init__(obj) is called by
+    # the RectangularPrismModel constructor
+    return obj
+
+class RectangularPrismModel(CRectangularPrismModel, BaseComponent):
+    """ 
+    Class that evaluates a RectangularPrismModel model. 
+    This file was auto-generated from src\sans\models\include\RectangularPrism.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * short_side      = 35.0 [A]
+    * b2a_ratio       = 1.0 [adim]
+    * c2a_ratio       = 1.0 [adim]
+    * sldPipe         = 6.3e-06 [1/A^(2)]
+    * sldSolv         = 1e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CRectangularPrismModel.__init__, (self,)) 
+
+        CRectangularPrismModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "RectangularPrismModel"
+        ## Model description
+        self.description = """
+         Form factor for a massive rectangular prism with uniform scattering length density.
+		scale:Scale factor
+		short_side: shortest side of the rectangular prism  [A]
+		b2a_ratio: ratio b/a [adim]
+		c2a_ratio: ratio c/a [adim]
+		sldPipe: Pipe_sld
+		sldSolv: solvent_sld
+		background:Incoherent Background [1/cm]
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['short_side'] = ['[A]', None, None]
+        self.details['b2a_ratio'] = ['[adim]', None, None]
+        self.details['c2a_ratio'] = ['[adim]', None, None]
+        self.details['sldPipe'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['short_side.width',
+                      'b2a_ratio.width',
+                      'c2a_ratio.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_RectangularPrismModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(RectangularPrismModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CRectangularPrismModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CRectangularPrismModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CRectangularPrismModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CRectangularPrismModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CRectangularPrismModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CRectangularPrismModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/ReflAdvModel.py
===================================================================
--- src/sans/models/ReflAdvModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/ReflAdvModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,338 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\refl_adv.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CReflAdvModel
+
+def create_ReflAdvModel():
+    """
+       Create a model instance
+    """
+    obj = ReflAdvModel()
+    # CReflAdvModel.__init__(obj) is called by
+    # the ReflAdvModel constructor
+    return obj
+
+class ReflAdvModel(CReflAdvModel, BaseComponent):
+    """ 
+    Class that evaluates a ReflAdvModel model. 
+    This file was auto-generated from src\sans\models\include\refl_adv.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * n_layers        = 1.0 
+    * scale           = 1.0 
+    * thick_inter0    = 50.0 [A]
+    * func_inter0     = 0.0 
+    * sld_bottom0     = 2.07e-06 [1/A^(2)]
+    * sld_medium      = 1e-06 [1/A^(2)]
+    * background      = 0.0 
+    * sld_flat1       = 4e-06 [1/A^(2)]
+    * sld_flat2       = 3.5e-06 [1/A^(2)]
+    * sld_flat3       = 4e-06 [1/A^(2)]
+    * sld_flat4       = 3.5e-06 [1/A^(2)]
+    * sld_flat5       = 4e-06 [1/A^(2)]
+    * sld_flat6       = 3.5e-06 [1/A^(2)]
+    * sld_flat7       = 4e-06 [1/A^(2)]
+    * sld_flat8       = 3.5e-06 [1/A^(2)]
+    * sld_flat9       = 4e-06 [1/A^(2)]
+    * sld_flat10      = 3.5e-06 [1/A^(2)]
+    * thick_inter1    = 50.0 [A]
+    * thick_inter2    = 50.0 [A]
+    * thick_inter3    = 50.0 [A]
+    * thick_inter4    = 50.0 [A]
+    * thick_inter5    = 50.0 [A]
+    * thick_inter6    = 50.0 [A]
+    * thick_inter7    = 50.0 [A]
+    * thick_inter8    = 50.0 [A]
+    * thick_inter9    = 50.0 [A]
+    * thick_inter10   = 50.0 [A]
+    * thick_flat1     = 100.0 [A]
+    * thick_flat2     = 100.0 [A]
+    * thick_flat3     = 100.0 [A]
+    * thick_flat4     = 100.0 [A]
+    * thick_flat5     = 100.0 [A]
+    * thick_flat6     = 100.0 [A]
+    * thick_flat7     = 100.0 [A]
+    * thick_flat8     = 100.0 [A]
+    * thick_flat9     = 100.0 [A]
+    * thick_flat10    = 100.0 [A]
+    * func_inter1     = 0.0 
+    * func_inter2     = 0.0 
+    * func_inter3     = 0.0 
+    * func_inter4     = 0.0 
+    * func_inter5     = 0.0 
+    * func_inter6     = 0.0 
+    * func_inter7     = 0.0 
+    * func_inter8     = 0.0 
+    * func_inter9     = 0.0 
+    * func_inter10    = 0.0 
+    * sldIM_flat1     = 0.0 [1/A^(2)]
+    * sldIM_flat2     = 0.0 [1/A^(2)]
+    * sldIM_flat3     = 0.0 [1/A^(2)]
+    * sldIM_flat4     = 0.0 [1/A^(2)]
+    * sldIM_flat5     = 0.0 [1/A^(2)]
+    * sldIM_flat6     = 0.0 [1/A^(2)]
+    * sldIM_flat7     = 0.0 [1/A^(2)]
+    * sldIM_flat8     = 0.0 [1/A^(2)]
+    * sldIM_flat9     = 0.0 [1/A^(2)]
+    * sldIM_flat10    = 0.0 [1/A^(2)]
+    * nu_inter1       = 2.5 
+    * nu_inter2       = 2.5 
+    * nu_inter3       = 2.5 
+    * nu_inter4       = 2.5 
+    * nu_inter5       = 2.5 
+    * nu_inter6       = 2.5 
+    * nu_inter7       = 2.5 
+    * nu_inter8       = 2.5 
+    * nu_inter9       = 2.5 
+    * nu_inter10      = 2.5 
+    * sldIM_sub0      = 0.0 
+    * sldIM_medium    = 0.0 
+    * npts_inter      = 21.0 
+    * nu_inter0       = 2.5 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CReflAdvModel.__init__, (self,)) 
+
+        CReflAdvModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "ReflAdvModel"
+        ## Model description
+        self.description = """
+        Calculate neutron reflectivity using the Parratt iterative formula
+		Parameters:
+		background:background
+		scale: scale factor
+		sld_bottom0: the SLD of the substrate
+		sld_medium: the SLD of the incident medium
+		or superstrate
+		sld_flatN: the SLD of the flat region of
+		the N'th layer
+		thick_flatN: the thickness of the flat
+		region of the N'th layer
+		func_interN: the function used to describe
+		the interface of the N'th layer
+		nu_interN: the coefficient for the func_interN
+		thick_interN: the thickness of the interface
+		of the N'th layer
+		Note: the layer number starts to increase
+		from the bottom (substrate) to the top.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['n_layers'] = ['', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['thick_inter0'] = ['[A]', None, None]
+        self.details['func_inter0'] = ['', None, None]
+        self.details['sld_bottom0'] = ['[1/A^(2)]', None, None]
+        self.details['sld_medium'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['', None, None]
+        self.details['sld_flat1'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat2'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat3'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat4'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat5'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat6'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat7'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat8'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat9'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat10'] = ['[1/A^(2)]', None, None]
+        self.details['thick_inter1'] = ['[A]', None, None]
+        self.details['thick_inter2'] = ['[A]', None, None]
+        self.details['thick_inter3'] = ['[A]', None, None]
+        self.details['thick_inter4'] = ['[A]', None, None]
+        self.details['thick_inter5'] = ['[A]', None, None]
+        self.details['thick_inter6'] = ['[A]', None, None]
+        self.details['thick_inter7'] = ['[A]', None, None]
+        self.details['thick_inter8'] = ['[A]', None, None]
+        self.details['thick_inter9'] = ['[A]', None, None]
+        self.details['thick_inter10'] = ['[A]', None, None]
+        self.details['thick_flat1'] = ['[A]', None, None]
+        self.details['thick_flat2'] = ['[A]', None, None]
+        self.details['thick_flat3'] = ['[A]', None, None]
+        self.details['thick_flat4'] = ['[A]', None, None]
+        self.details['thick_flat5'] = ['[A]', None, None]
+        self.details['thick_flat6'] = ['[A]', None, None]
+        self.details['thick_flat7'] = ['[A]', None, None]
+        self.details['thick_flat8'] = ['[A]', None, None]
+        self.details['thick_flat9'] = ['[A]', None, None]
+        self.details['thick_flat10'] = ['[A]', None, None]
+        self.details['func_inter1'] = ['', None, None]
+        self.details['func_inter2'] = ['', None, None]
+        self.details['func_inter3'] = ['', None, None]
+        self.details['func_inter4'] = ['', None, None]
+        self.details['func_inter5'] = ['', None, None]
+        self.details['func_inter6'] = ['', None, None]
+        self.details['func_inter7'] = ['', None, None]
+        self.details['func_inter8'] = ['', None, None]
+        self.details['func_inter9'] = ['', None, None]
+        self.details['func_inter10'] = ['', None, None]
+        self.details['sldIM_flat1'] = ['[1/A^(2)]', None, None]
+        self.details['sldIM_flat2'] = ['[1/A^(2)]', None, None]
+        self.details['sldIM_flat3'] = ['[1/A^(2)]', None, None]
+        self.details['sldIM_flat4'] = ['[1/A^(2)]', None, None]
+        self.details['sldIM_flat5'] = ['[1/A^(2)]', None, None]
+        self.details['sldIM_flat6'] = ['[1/A^(2)]', None, None]
+        self.details['sldIM_flat7'] = ['[1/A^(2)]', None, None]
+        self.details['sldIM_flat8'] = ['[1/A^(2)]', None, None]
+        self.details['sldIM_flat9'] = ['[1/A^(2)]', None, None]
+        self.details['sldIM_flat10'] = ['[1/A^(2)]', None, None]
+        self.details['nu_inter1'] = ['', None, None]
+        self.details['nu_inter2'] = ['', None, None]
+        self.details['nu_inter3'] = ['', None, None]
+        self.details['nu_inter4'] = ['', None, None]
+        self.details['nu_inter5'] = ['', None, None]
+        self.details['nu_inter6'] = ['', None, None]
+        self.details['nu_inter7'] = ['', None, None]
+        self.details['nu_inter8'] = ['', None, None]
+        self.details['nu_inter9'] = ['', None, None]
+        self.details['nu_inter10'] = ['', None, None]
+        self.details['sldIM_sub0'] = ['', None, None]
+        self.details['sldIM_medium'] = ['', None, None]
+        self.details['npts_inter'] = ['', None, None]
+        self.details['nu_inter0'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = ['n_layers',
+                             'func_inter0',
+                             'func_inter1',
+                             'func_inter2',
+                             'func_inter3',
+                             'func_inter4',
+                             'func_inter5',
+                             'func_inter5',
+                             'func_inter7',
+                             'func_inter8',
+                             'func_inter9',
+                             'func_inter10']
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_ReflAdvModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(ReflAdvModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CReflAdvModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CReflAdvModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CReflAdvModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CReflAdvModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CReflAdvModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CReflAdvModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/ReflModel.py
===================================================================
--- src/sans/models/ReflModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/ReflModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,289 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\refl.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CReflModel
+
+def create_ReflModel():
+    """
+       Create a model instance
+    """
+    obj = ReflModel()
+    # CReflModel.__init__(obj) is called by
+    # the ReflModel constructor
+    return obj
+
+class ReflModel(CReflModel, BaseComponent):
+    """ 
+    Class that evaluates a ReflModel model. 
+    This file was auto-generated from src\sans\models\include\refl.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * n_layers        = 1.0 
+    * scale           = 1.0 
+    * thick_inter0    = 1.0 [A]
+    * func_inter0     = 0.0 
+    * sld_bottom0     = 2.07e-06 [1/A^(2)]
+    * sld_medium      = 1e-06 [1/A^(2)]
+    * background      = 0.0 
+    * sld_flat1       = 4e-06 [1/A^(2)]
+    * sld_flat2       = 3.5e-06 [1/A^(2)]
+    * sld_flat3       = 4e-06 [1/A^(2)]
+    * sld_flat4       = 3.5e-06 [1/A^(2)]
+    * sld_flat5       = 4e-06 [1/A^(2)]
+    * sld_flat6       = 3.5e-06 [1/A^(2)]
+    * sld_flat7       = 4e-06 [1/A^(2)]
+    * sld_flat8       = 3.5e-06 [1/A^(2)]
+    * sld_flat9       = 4e-06 [1/A^(2)]
+    * sld_flat10      = 3.5e-06 [1/A^(2)]
+    * thick_inter1    = 1.0 [A]
+    * thick_inter2    = 1.0 [A]
+    * thick_inter3    = 1.0 [A]
+    * thick_inter4    = 1.0 [A]
+    * thick_inter5    = 1.0 [A]
+    * thick_inter6    = 1.0 [A]
+    * thick_inter7    = 1.0 [A]
+    * thick_inter8    = 1.0 [A]
+    * thick_inter9    = 1.0 [A]
+    * thick_inter10   = 1.0 [A]
+    * thick_flat1     = 10.0 [A]
+    * thick_flat2     = 100.0 [A]
+    * thick_flat3     = 100.0 [A]
+    * thick_flat4     = 100.0 [A]
+    * thick_flat5     = 100.0 [A]
+    * thick_flat6     = 100.0 [A]
+    * thick_flat7     = 100.0 [A]
+    * thick_flat8     = 100.0 [A]
+    * thick_flat9     = 100.0 [A]
+    * thick_flat10    = 100.0 [A]
+    * func_inter1     = 0.0 
+    * func_inter2     = 0.0 
+    * func_inter3     = 0.0 
+    * func_inter4     = 0.0 
+    * func_inter5     = 0.0 
+    * func_inter6     = 0.0 
+    * func_inter7     = 0.0 
+    * func_inter8     = 0.0 
+    * func_inter9     = 0.0 
+    * func_inter10    = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CReflModel.__init__, (self,)) 
+
+        CReflModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "ReflModel"
+        ## Model description
+        self.description = """
+        Calculate neutron reflectivity using the Parratt iterative formula
+		Parameters:
+		background:background
+		scale: scale factor
+		sld_bottom0: the SLD of the substrate
+		sld_medium: the SLD of the incident medium
+		or superstrate
+		sld_flatN: the SLD of the flat region of
+		the N'th layer
+		thick_flatN: the thickness of the flat
+		region of the N'th layer
+		func_interN: the function used to describe
+		the interface of the N'th layer
+		thick_interN: the thickness of the interface
+		of the N'th layer
+		Note: the layer number starts to increase
+		from the bottom (substrate) to the top.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['n_layers'] = ['', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['thick_inter0'] = ['[A]', None, None]
+        self.details['func_inter0'] = ['', None, None]
+        self.details['sld_bottom0'] = ['[1/A^(2)]', None, None]
+        self.details['sld_medium'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['', None, None]
+        self.details['sld_flat1'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat2'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat3'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat4'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat5'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat6'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat7'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat8'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat9'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat10'] = ['[1/A^(2)]', None, None]
+        self.details['thick_inter1'] = ['[A]', None, None]
+        self.details['thick_inter2'] = ['[A]', None, None]
+        self.details['thick_inter3'] = ['[A]', None, None]
+        self.details['thick_inter4'] = ['[A]', None, None]
+        self.details['thick_inter5'] = ['[A]', None, None]
+        self.details['thick_inter6'] = ['[A]', None, None]
+        self.details['thick_inter7'] = ['[A]', None, None]
+        self.details['thick_inter8'] = ['[A]', None, None]
+        self.details['thick_inter9'] = ['[A]', None, None]
+        self.details['thick_inter10'] = ['[A]', None, None]
+        self.details['thick_flat1'] = ['[A]', None, None]
+        self.details['thick_flat2'] = ['[A]', None, None]
+        self.details['thick_flat3'] = ['[A]', None, None]
+        self.details['thick_flat4'] = ['[A]', None, None]
+        self.details['thick_flat5'] = ['[A]', None, None]
+        self.details['thick_flat6'] = ['[A]', None, None]
+        self.details['thick_flat7'] = ['[A]', None, None]
+        self.details['thick_flat8'] = ['[A]', None, None]
+        self.details['thick_flat9'] = ['[A]', None, None]
+        self.details['thick_flat10'] = ['[A]', None, None]
+        self.details['func_inter1'] = ['', None, None]
+        self.details['func_inter2'] = ['', None, None]
+        self.details['func_inter3'] = ['', None, None]
+        self.details['func_inter4'] = ['', None, None]
+        self.details['func_inter5'] = ['', None, None]
+        self.details['func_inter6'] = ['', None, None]
+        self.details['func_inter7'] = ['', None, None]
+        self.details['func_inter8'] = ['', None, None]
+        self.details['func_inter9'] = ['', None, None]
+        self.details['func_inter10'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = ['n_layers',
+                             'func_inter0',
+                             'func_inter1',
+                             'func_inter2',
+                             'func_inter3',
+                             'func_inter4',
+                             'func_inter5',
+                             'func_inter5',
+                             'func_inter7',
+                             'func_inter8',
+                             'func_inter9',
+                             'func_inter10']
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_ReflModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(ReflModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CReflModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CReflModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CReflModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CReflModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CReflModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CReflModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/SCCrystalModel.py
===================================================================
--- src/sans/models/SCCrystalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/SCCrystalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,213 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\sc.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CSCCrystalModel
+
+def create_SCCrystalModel():
+    """
+       Create a model instance
+    """
+    obj = SCCrystalModel()
+    # CSCCrystalModel.__init__(obj) is called by
+    # the SCCrystalModel constructor
+    return obj
+
+class SCCrystalModel(CSCCrystalModel, BaseComponent):
+    """ 
+    Class that evaluates a SCCrystalModel model. 
+    This file was auto-generated from src\sans\models\include\sc.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * dnn             = 220.0 [A]
+    * d_factor        = 0.06 
+    * radius          = 40.0 [A]
+    * sldSph          = 3e-06 [1/A^(2)]
+    * sldSolv         = 6.3e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * theta           = 0.0 [deg]
+    * phi             = 0.0 [deg]
+    * psi             = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CSCCrystalModel.__init__, (self,)) 
+
+        CSCCrystalModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "SCCrystalModel"
+        ## Model description
+        self.description = """
+        P(q)=(scale/Vp)*V_lattice*P(q)*Z(q)+bkg where scale is the volume
+		fraction of sphere,
+		Vp = volume of the primary particle,
+		V_lattice = volume correction for
+		for the crystal structure,
+		P(q)= form factor of the sphere (normalized),
+		Z(q)= paracrystalline structure factor
+		for a simple cubic structure.
+		[Simple Cubic ParaCrystal Model]
+		Parameters;
+		scale: volume fraction of spheres
+		bkg:background, R: radius of sphere
+		dnn: Nearest neighbor distance
+		d_factor: Paracrystal distortion factor
+		radius: radius of the spheres
+		sldSph: SLD of the sphere
+		sldSolv: SLD of the solvent
+		
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['dnn'] = ['[A]', None, None]
+        self.details['d_factor'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['sldSph'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['theta'] = ['[deg]', None, None]
+        self.details['phi'] = ['[deg]', None, None]
+        self.details['psi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius.width',
+                      'phi.width',
+                      'psi.width',
+                      'theta.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['phi',
+                                   'psi',
+                                   'theta',
+                                   'phi.width',
+                                   'psi.width',
+                                   'theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_SCCrystalModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(SCCrystalModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSCCrystalModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSCCrystalModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CSCCrystalModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CSCCrystalModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CSCCrystalModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CSCCrystalModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/SLDCalFunc.py
===================================================================
--- src/sans/models/SLDCalFunc.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/SLDCalFunc.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,180 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\sld_cal.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CSLDCalFunc
+
+def create_SLDCalFunc():
+    """
+       Create a model instance
+    """
+    obj = SLDCalFunc()
+    # CSLDCalFunc.__init__(obj) is called by
+    # the SLDCalFunc constructor
+    return obj
+
+class SLDCalFunc(CSLDCalFunc, BaseComponent):
+    """ 
+    Class that evaluates a SLDCalFunc model. 
+    This file was auto-generated from src\sans\models\include\sld_cal.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * fun_type        = 0.0 
+    * npts_inter      = 21.0 
+    * shell_num       = 0.0 
+    * nu_inter        = 2.5 
+    * sld_left        = 0.0 [1/A^(2)]
+    * sld_right       = 0.0 [1/A^(2)]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CSLDCalFunc.__init__, (self,)) 
+
+        CSLDCalFunc.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "SLDCalFunc"
+        ## Model description
+        self.description = """
+        To calculate sld values
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['fun_type'] = ['', None, None]
+        self.details['npts_inter'] = ['', None, None]
+        self.details['shell_num'] = ['', None, None]
+        self.details['nu_inter'] = ['', None, None]
+        self.details['sld_left'] = ['[1/A^(2)]', None, None]
+        self.details['sld_right'] = ['[1/A^(2)]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['</text>']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_SLDCalFunc, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(SLDCalFunc())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSLDCalFunc.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSLDCalFunc.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CSLDCalFunc.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CSLDCalFunc.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CSLDCalFunc.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CSLDCalFunc.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/Schulz.py
===================================================================
--- src/sans/models/Schulz.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/Schulz.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,176 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\schulz.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CSchulz
+
+def create_Schulz():
+    """
+       Create a model instance
+    """
+    obj = Schulz()
+    # CSchulz.__init__(obj) is called by
+    # the Schulz constructor
+    return obj
+
+class Schulz(CSchulz, BaseComponent):
+    """ 
+    Class that evaluates a Schulz model. 
+    This file was auto-generated from src\sans\models\include\schulz.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * sigma           = 1.0 
+    * center          = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CSchulz.__init__, (self,)) 
+
+        CSchulz.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "Schulz"
+        ## Model description
+        self.description = """
+         f(x)=scale * math.pow(z+1, z+1)*math.pow((R), z)*
+		math.exp(-R*(z+1))/(center*gamma(z+1)
+		z= math.pow[(1/(sigma/center),2]-1
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['sigma'] = ['', None, None]
+        self.details['center'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_Schulz, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(Schulz())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSchulz.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSchulz.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CSchulz.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CSchulz.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CSchulz.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CSchulz.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/SchulzHuber.py
===================================================================
--- src/sans/models/SchulzHuber.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/SchulzHuber.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,176 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\schulzhuber.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CSchulzHuber
+
+def create_SchulzHuber():
+    """
+       Create a model instance
+    """
+    obj = SchulzHuber()
+    # CSchulzHuber.__init__(obj) is called by
+    # the SchulzHuber constructor
+    return obj
+
+class SchulzHuber(CSchulzHuber, BaseComponent):
+    """ 
+    Class that evaluates a SchulzHuber model. 
+    This file was auto-generated from src\sans\models\include\schulzhuber.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * sigma           = 1.0 
+    * center          = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CSchulzHuber.__init__, (self,)) 
+
+        CSchulzHuber.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "SchulzHuber"
+        ## Model description
+        self.description = """
+         f(x) = scale * math.pow(z+1, z) * math.pow((R), z-1) *
+		math.exp(-R*z) / (center*gamma(z+1))
+		z= math.pow[(1/(sigma/center),2]-1
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['sigma'] = ['', None, None]
+        self.details['center'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_SchulzHuber, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(SchulzHuber())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSchulzHuber.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSchulzHuber.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CSchulzHuber.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CSchulzHuber.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CSchulzHuber.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CSchulzHuber.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/SphereModel.py
===================================================================
--- src/sans/models/SphereModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/SphereModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,211 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\sphere.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CSphereModel
+
+def create_SphereModel():
+    """
+       Create a model instance
+    """
+    obj = SphereModel()
+    # CSphereModel.__init__(obj) is called by
+    # the SphereModel constructor
+    return obj
+
+class SphereModel(CSphereModel, BaseComponent):
+    """ 
+    Class that evaluates a SphereModel model. 
+    This file was auto-generated from src\sans\models\include\sphere.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * radius          = 60.0 [A]
+    * sldSph          = 2e-06 [1/A^(2)]
+    * sldSolv         = 1e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * M0_sld_sph      = 0.0 [1/A^(2)]
+    * M_theta_sph     = 0.0 [deg]
+    * M_phi_sph       = 0.0 [deg]
+    * M0_sld_solv     = 0.0 [1/A^(2)]
+    * M_theta_solv    = 0.0 [deg]
+    * M_phi_solv      = 0.0 [deg]
+    * Up_frac_i       = 0.5 [u/(u+d)]
+    * Up_frac_f       = 0.5 [u/(u+d)]
+    * Up_theta        = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CSphereModel.__init__, (self,)) 
+
+        CSphereModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "SphereModel"
+        ## Model description
+        self.description = """
+        P(q)=(scale/V)*[3V(sldSph-sldSolv)*(sin(qR)-qRcos(qR))
+		/(qR)^3]^(2)+bkg
+		
+		bkg:background, R: radius of sphere
+		V:The volume of the scatter
+		sldSph: the SLD of the sphere
+		sldSolv: the SLD of the solvent
+		
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['sldSph'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['M0_sld_sph'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_sph'] = ['[deg]', None, None]
+        self.details['M_phi_sph'] = ['[deg]', None, None]
+        self.details['M0_sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['M_theta_solv'] = ['[deg]', None, None]
+        self.details['M_phi_solv'] = ['[deg]', None, None]
+        self.details['Up_frac_i'] = ['[u/(u+d)]', None, None]
+        self.details['Up_frac_f'] = ['[u/(u+d)]', None, None]
+        self.details['Up_theta'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['M0_sld_sph',
+                                   'M_theta_sph',
+                                   'M_phi_sph',
+                                   'M0_sld_solv',
+                                   'M_theta_solv',
+                                   'M_phi_solv',
+                                   'Up_frac_i',
+                                   'Up_frac_f',
+                                   'Up_theta']
+
+        ## parameters with magnetism
+        self.magnetic_params = ['M0_sld_sph', 'M_theta_sph', 'M_phi_sph', 'M0_sld_solv', 'M_theta_solv', 'M_phi_solv', 'Up_frac_i', 'Up_frac_f', 'Up_theta']
+
+        self.category = "Shapes & Spheres"
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_SphereModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(SphereModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSphereModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSphereModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CSphereModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CSphereModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CSphereModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CSphereModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/SphereSLDModel.py
===================================================================
--- src/sans/models/SphereSLDModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/SphereSLDModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,317 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\spheresld.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CSphereSLDModel
+
+def create_SphereSLDModel():
+    """
+       Create a model instance
+    """
+    obj = SphereSLDModel()
+    # CSphereSLDModel.__init__(obj) is called by
+    # the SphereSLDModel constructor
+    return obj
+
+class SphereSLDModel(CSphereSLDModel, BaseComponent):
+    """ 
+    Class that evaluates a SphereSLDModel model. 
+    This file was auto-generated from src\sans\models\include\spheresld.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * n_shells        = 1.0 
+    * scale           = 1.0 
+    * thick_inter0    = 50.0 [A]
+    * func_inter0     = 0.0 
+    * sld_core0       = 2.07e-06 [1/A^(2)]
+    * sld_solv        = 1e-06 [1/A^(2)]
+    * background      = 0.0 
+    * sld_flat1       = 4e-06 [1/A^(2)]
+    * sld_flat2       = 3.5e-06 [1/A^(2)]
+    * sld_flat3       = 4e-06 [1/A^(2)]
+    * sld_flat4       = 3.5e-06 [1/A^(2)]
+    * sld_flat5       = 4e-06 [1/A^(2)]
+    * sld_flat6       = 3.5e-06 [1/A^(2)]
+    * sld_flat7       = 4e-06 [1/A^(2)]
+    * sld_flat8       = 3.5e-06 [1/A^(2)]
+    * sld_flat9       = 4e-06 [1/A^(2)]
+    * sld_flat10      = 3.5e-06 [1/A^(2)]
+    * thick_inter1    = 50.0 [A]
+    * thick_inter2    = 50.0 [A]
+    * thick_inter3    = 50.0 [A]
+    * thick_inter4    = 50.0 [A]
+    * thick_inter5    = 50.0 [A]
+    * thick_inter6    = 50.0 [A]
+    * thick_inter7    = 50.0 [A]
+    * thick_inter8    = 50.0 [A]
+    * thick_inter9    = 50.0 [A]
+    * thick_inter10   = 50.0 [A]
+    * thick_flat1     = 100.0 [A]
+    * thick_flat2     = 100.0 [A]
+    * thick_flat3     = 100.0 [A]
+    * thick_flat4     = 100.0 [A]
+    * thick_flat5     = 100.0 [A]
+    * thick_flat6     = 100.0 [A]
+    * thick_flat7     = 100.0 [A]
+    * thick_flat8     = 100.0 [A]
+    * thick_flat9     = 100.0 [A]
+    * thick_flat10    = 100.0 [A]
+    * func_inter1     = 0.0 
+    * func_inter2     = 0.0 
+    * func_inter3     = 0.0 
+    * func_inter4     = 0.0 
+    * func_inter5     = 0.0 
+    * func_inter6     = 0.0 
+    * func_inter7     = 0.0 
+    * func_inter8     = 0.0 
+    * func_inter9     = 0.0 
+    * func_inter10    = 0.0 
+    * nu_inter1       = 2.5 
+    * nu_inter2       = 2.5 
+    * nu_inter3       = 2.5 
+    * nu_inter4       = 2.5 
+    * nu_inter5       = 2.5 
+    * nu_inter6       = 2.5 
+    * nu_inter7       = 2.5 
+    * nu_inter8       = 2.5 
+    * nu_inter9       = 2.5 
+    * nu_inter10      = 2.5 
+    * npts_inter      = 35.0 
+    * nu_inter0       = 2.5 
+    * rad_core0       = 50.0 [A]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CSphereSLDModel.__init__, (self,)) 
+
+        CSphereSLDModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "SphereSLDModel"
+        ## Model description
+        self.description = """
+        Calculate neutron reflectivity using the Parratt iterative formula
+		Parameters:
+		background:background
+		scale: scale factor
+		sld_core0: the SLD of the substrate
+		sld_solv: the SLD of the incident medium
+		or superstrate
+		sld_flatN: the SLD of the flat region of
+		the N'th layer
+		thick_flatN: the thickness of the flat
+		region of the N'th layer
+		func_interN: the function used to describe
+		the interface of the N'th layer
+		nu_interN: the coefficient for the func_interN
+		thick_interN: the thickness of the interface
+		of the N'th layer
+		Note: the layer number starts to increase
+		from the bottom (substrate) to the top.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['n_shells'] = ['', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['thick_inter0'] = ['[A]', None, None]
+        self.details['func_inter0'] = ['', None, None]
+        self.details['sld_core0'] = ['[1/A^(2)]', None, None]
+        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['', None, None]
+        self.details['sld_flat1'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat2'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat3'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat4'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat5'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat6'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat7'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat8'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat9'] = ['[1/A^(2)]', None, None]
+        self.details['sld_flat10'] = ['[1/A^(2)]', None, None]
+        self.details['thick_inter1'] = ['[A]', None, None]
+        self.details['thick_inter2'] = ['[A]', None, None]
+        self.details['thick_inter3'] = ['[A]', None, None]
+        self.details['thick_inter4'] = ['[A]', None, None]
+        self.details['thick_inter5'] = ['[A]', None, None]
+        self.details['thick_inter6'] = ['[A]', None, None]
+        self.details['thick_inter7'] = ['[A]', None, None]
+        self.details['thick_inter8'] = ['[A]', None, None]
+        self.details['thick_inter9'] = ['[A]', None, None]
+        self.details['thick_inter10'] = ['[A]', None, None]
+        self.details['thick_flat1'] = ['[A]', None, None]
+        self.details['thick_flat2'] = ['[A]', None, None]
+        self.details['thick_flat3'] = ['[A]', None, None]
+        self.details['thick_flat4'] = ['[A]', None, None]
+        self.details['thick_flat5'] = ['[A]', None, None]
+        self.details['thick_flat6'] = ['[A]', None, None]
+        self.details['thick_flat7'] = ['[A]', None, None]
+        self.details['thick_flat8'] = ['[A]', None, None]
+        self.details['thick_flat9'] = ['[A]', None, None]
+        self.details['thick_flat10'] = ['[A]', None, None]
+        self.details['func_inter1'] = ['', None, None]
+        self.details['func_inter2'] = ['', None, None]
+        self.details['func_inter3'] = ['', None, None]
+        self.details['func_inter4'] = ['', None, None]
+        self.details['func_inter5'] = ['', None, None]
+        self.details['func_inter6'] = ['', None, None]
+        self.details['func_inter7'] = ['', None, None]
+        self.details['func_inter8'] = ['', None, None]
+        self.details['func_inter9'] = ['', None, None]
+        self.details['func_inter10'] = ['', None, None]
+        self.details['nu_inter1'] = ['', None, None]
+        self.details['nu_inter2'] = ['', None, None]
+        self.details['nu_inter3'] = ['', None, None]
+        self.details['nu_inter4'] = ['', None, None]
+        self.details['nu_inter5'] = ['', None, None]
+        self.details['nu_inter6'] = ['', None, None]
+        self.details['nu_inter7'] = ['', None, None]
+        self.details['nu_inter8'] = ['', None, None]
+        self.details['nu_inter9'] = ['', None, None]
+        self.details['nu_inter10'] = ['', None, None]
+        self.details['npts_inter'] = ['', None, None]
+        self.details['nu_inter0'] = ['', None, None]
+        self.details['rad_core0'] = ['[A]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['rad_core0.width',
+                      'thick_inter0.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = ['n_shells',
+                             'func_inter0',
+                             'func_inter1',
+                             'func_inter2',
+                             'func_inter3',
+                             'func_inter4',
+                             'func_inter5',
+                             'func_inter5',
+                             'func_inter7',
+                             'func_inter8',
+                             'func_inter9',
+                             'func_inter10']
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_SphereSLDModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(SphereSLDModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSphereSLDModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSphereSLDModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CSphereSLDModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CSphereSLDModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CSphereSLDModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CSphereSLDModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/SquareWellStructure.py
===================================================================
--- src/sans/models/SquareWellStructure.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/SquareWellStructure.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,191 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\SquareWell.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CSquareWellStructure
+
+def create_SquareWellStructure():
+    """
+       Create a model instance
+    """
+    obj = SquareWellStructure()
+    # CSquareWellStructure.__init__(obj) is called by
+    # the SquareWellStructure constructor
+    return obj
+
+class SquareWellStructure(CSquareWellStructure, BaseComponent):
+    """ 
+    Class that evaluates a SquareWellStructure model. 
+    This file was auto-generated from src\sans\models\include\SquareWell.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * effect_radius   = 50.0 [A]
+    * volfraction     = 0.04 
+    * welldepth       = 1.5 [kT]
+    * wellwidth       = 1.2 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CSquareWellStructure.__init__, (self,)) 
+
+        CSquareWellStructure.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "SquareWellStructure"
+        ## Model description
+        self.description = """
+         Structure Factor for interacting particles:             .
+		
+		The interaction potential is
+		
+		U(r)= inf   , r < 2R
+		= -d    , 2R <= r <=2Rw
+		= 0     , r >= 2Rw
+		
+		R: effective radius (A)of the particle
+		v: volume fraction
+		d: well depth
+		w: well width; multiples of the
+		particle diameter
+		
+		Ref: Sharma, R. V.; Sharma,
+		K. C., Physica, 1977, 89A, 213.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['effect_radius'] = ['[A]', None, None]
+        self.details['volfraction'] = ['', None, None]
+        self.details['welldepth'] = ['[kT]', None, None]
+        self.details['wellwidth'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = ['effect_radius.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_SquareWellStructure, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(SquareWellStructure())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSquareWellStructure.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSquareWellStructure.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CSquareWellStructure.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CSquareWellStructure.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CSquareWellStructure.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CSquareWellStructure.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/StackedDisksModel.py
===================================================================
--- src/sans/models/StackedDisksModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/StackedDisksModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,207 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\stacked_disks.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CStackedDisksModel
+
+def create_StackedDisksModel():
+    """
+       Create a model instance
+    """
+    obj = StackedDisksModel()
+    # CStackedDisksModel.__init__(obj) is called by
+    # the StackedDisksModel constructor
+    return obj
+
+class StackedDisksModel(CStackedDisksModel, BaseComponent):
+    """ 
+    Class that evaluates a StackedDisksModel model. 
+    This file was auto-generated from src\sans\models\include\stacked_disks.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 0.01 
+    * core_thick      = 10.0 [A]
+    * radius          = 3000.0 [A]
+    * layer_thick     = 15.0 [A]
+    * core_sld        = 4e-06 [1/A^(2)]
+    * layer_sld       = -4e-07 [1/A^(2)]
+    * solvent_sld     = 5e-06 [1/A^(2)]
+    * n_stacking      = 1.0 
+    * sigma_d         = 0.0 
+    * background      = 0.001 [1/cm]
+    * axis_theta      = 0.0 [rad]
+    * axis_phi        = 0.0 [rad]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CStackedDisksModel.__init__, (self,)) 
+
+        CStackedDisksModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "StackedDisksModel"
+        ## Model description
+        self.description = """
+         One layer of disk consists of a core, a top layer, and a bottom layer.
+		radius =  the radius of the disk
+		core_thick = thickness of the core
+		layer_thick = thickness of a layer
+		core_sld = the SLD of the core
+		layer_sld = the SLD of the layers
+		n_stacking = the number of the disks
+		sigma_d =  Gaussian STD of d-spacing
+		solvent_sld = the SLD of the solvent
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['core_thick'] = ['[A]', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['layer_thick'] = ['[A]', None, None]
+        self.details['core_sld'] = ['[1/A^(2)]', None, None]
+        self.details['layer_sld'] = ['[1/A^(2)]', None, None]
+        self.details['solvent_sld'] = ['[1/A^(2)]', None, None]
+        self.details['n_stacking'] = ['', None, None]
+        self.details['sigma_d'] = ['', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['axis_theta'] = ['[rad]', None, None]
+        self.details['axis_phi'] = ['[rad]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['core_thick.width',
+                      'layer_thick.width',
+                      'radius.width',
+                      'axis_theta.width',
+                      'axis_phi.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['axis_phi',
+                                   'axis_theta',
+                                   'axis_phi.width',
+                                   'axis_theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_StackedDisksModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(StackedDisksModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CStackedDisksModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CStackedDisksModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CStackedDisksModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CStackedDisksModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CStackedDisksModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CStackedDisksModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/StarPolymer.py
===================================================================
--- src/sans/models/StarPolymer.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/StarPolymer.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,183 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\starpolymer.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CStarPolymer
+
+def create_StarPolymer():
+    """
+       Create a model instance
+    """
+    obj = StarPolymer()
+    # CStarPolymer.__init__(obj) is called by
+    # the StarPolymer constructor
+    return obj
+
+class StarPolymer(CStarPolymer, BaseComponent):
+    """ 
+    Class that evaluates a StarPolymer model. 
+    This file was auto-generated from src\sans\models\include\starpolymer.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * arms            = 3.0 
+    * R2              = 100.0 [A]
+    * scale           = 1.0 
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CStarPolymer.__init__, (self,)) 
+
+        CStarPolymer.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "StarPolymer"
+        ## Model description
+        self.description = """
+          Scattering model class for 'Star polymer with Gaussian statistics'
+		with
+		P(q) = 2/{fv^2} * (v - (1-exp(-v)) + {f-1}/2 * (1-exp(-v))^2)
+		where
+		- v = u^2f/(3f-2)
+		- u = <R_g^2>q^2, where <R_g^2> is the ensemble average radius of
+		giration squared of an arm
+		- f is the number of arms on the star
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['arms'] = ['', None, None]
+        self.details['R2'] = ['[A]', None, None]
+        self.details['scale'] = ['', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_StarPolymer, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(StarPolymer())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CStarPolymer.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CStarPolymer.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CStarPolymer.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CStarPolymer.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CStarPolymer.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CStarPolymer.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/StickyHSStructure.py
===================================================================
--- src/sans/models/StickyHSStructure.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/StickyHSStructure.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,191 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\StickyHS.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CStickyHSStructure
+
+def create_StickyHSStructure():
+    """
+       Create a model instance
+    """
+    obj = StickyHSStructure()
+    # CStickyHSStructure.__init__(obj) is called by
+    # the StickyHSStructure constructor
+    return obj
+
+class StickyHSStructure(CStickyHSStructure, BaseComponent):
+    """ 
+    Class that evaluates a StickyHSStructure model. 
+    This file was auto-generated from src\sans\models\include\StickyHS.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * effect_radius   = 50.0 [A]
+    * volfraction     = 0.1 
+    * perturb         = 0.05 
+    * stickiness      = 0.2 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CStickyHSStructure.__init__, (self,)) 
+
+        CStickyHSStructure.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "StickyHSStructure"
+        ## Model description
+        self.description = """
+         Structure Factor for interacting particles:                               .
+		
+		The interaction potential is
+		
+		U(r)= inf , r < 2R
+		= -Uo  , 2R < r < 2R + w
+		= 0   , r >= 2R +w
+		
+		R: effective radius of the hardsphere
+		stickiness = [exp(Uo/kT)]/(12*perturb)
+		perturb = w/(w+ 2R) , 0.01 =< w <= 0.1
+		w: The width of the square well ,w > 0
+		v: The volume fraction , v > 0
+		
+		Ref: Menon, S. V. G.,et.al., J. Chem.
+		Phys., 1991, 95(12), 9186-9190.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['effect_radius'] = ['[A]', None, None]
+        self.details['volfraction'] = ['', None, None]
+        self.details['perturb'] = ['', None, None]
+        self.details['stickiness'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = ['effect_radius.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_StickyHSStructure, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(StickyHSStructure())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CStickyHSStructure.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CStickyHSStructure.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CStickyHSStructure.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CStickyHSStructure.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CStickyHSStructure.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CStickyHSStructure.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/SurfaceFractalModel.py
===================================================================
--- src/sans/models/SurfaceFractalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/SurfaceFractalModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,191 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\surfacefractal.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CSurfaceFractalModel
+
+def create_SurfaceFractalModel():
+    """
+       Create a model instance
+    """
+    obj = SurfaceFractalModel()
+    # CSurfaceFractalModel.__init__(obj) is called by
+    # the SurfaceFractalModel constructor
+    return obj
+
+class SurfaceFractalModel(CSurfaceFractalModel, BaseComponent):
+    """ 
+    Class that evaluates a SurfaceFractalModel model. 
+    This file was auto-generated from src\sans\models\include\surfacefractal.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * radius          = 10.0 [A]
+    * surface_dim     = 2.0 
+    * co_length       = 500.0 [A]
+    * background      = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CSurfaceFractalModel.__init__, (self,)) 
+
+        CSurfaceFractalModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "SurfaceFractalModel"
+        ## Model description
+        self.description = """
+         The scattering intensity  I(x) = scale*P(x)*S(x) + background, where
+		scale = scale_factor  * V * delta^(2)
+		p(x)=  F(x*radius)^(2)
+		F(x) = 3*[sin(x)-x cos(x)]/x**3
+		S(x) = [(gamma(5-Ds)*colength^(5-Ds)*[1+(x^2*colength^2)]^((Ds-5)/2)
+		* sin[(Ds-5)*arctan(x*colength)])/x]
+		where delta = sldParticle -sldSolv.
+		radius       =  Particle radius
+		surface_dim  =  Surface fractal dimension (Ds)
+		co_length  =  Cut-off length
+		background   =  background
+		Ref.:Mildner, Hall,J Phys D Appl Phys(1986), 19, 1535-1545
+		Note I: This model is valid for 1<surface_dim<3 with limited q range.
+		Note II: This model is not in absolute scale.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['surface_dim'] = ['', None, None]
+        self.details['co_length'] = ['[A]', None, None]
+        self.details['background'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_SurfaceFractalModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(SurfaceFractalModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSurfaceFractalModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CSurfaceFractalModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CSurfaceFractalModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CSurfaceFractalModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CSurfaceFractalModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CSurfaceFractalModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/TeubnerStreyModel.py
===================================================================
--- src/sans/models/TeubnerStreyModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/TeubnerStreyModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,176 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\teubner_strey.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CTeubnerStreyModel
+
+def create_TeubnerStreyModel():
+    """
+       Create a model instance
+    """
+    obj = TeubnerStreyModel()
+    # CTeubnerStreyModel.__init__(obj) is called by
+    # the TeubnerStreyModel constructor
+    return obj
+
+class TeubnerStreyModel(CTeubnerStreyModel, BaseComponent):
+    """ 
+    Class that evaluates a TeubnerStreyModel model. 
+    This file was auto-generated from src\sans\models\include\teubner_strey.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 0.1 
+    * c1              = -30.0 
+    * c2              = 5000.0 
+    * background      = 0.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CTeubnerStreyModel.__init__, (self,)) 
+
+        CTeubnerStreyModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "TeubnerStreyModel"
+        ## Model description
+        self.description = """
+        F(x) = 1/( scale + c1*(x)^(2)+  c2*(x)^(4)) + bkd 
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['c1'] = ['', None, None]
+        self.details['c2'] = ['', None, None]
+        self.details['background'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_TeubnerStreyModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(TeubnerStreyModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CTeubnerStreyModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CTeubnerStreyModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CTeubnerStreyModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CTeubnerStreyModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CTeubnerStreyModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CTeubnerStreyModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/TriaxialEllipsoidModel.py
===================================================================
--- src/sans/models/TriaxialEllipsoidModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/TriaxialEllipsoidModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,200 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\triaxial_ellipsoid.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CTriaxialEllipsoidModel
+
+def create_TriaxialEllipsoidModel():
+    """
+       Create a model instance
+    """
+    obj = TriaxialEllipsoidModel()
+    # CTriaxialEllipsoidModel.__init__(obj) is called by
+    # the TriaxialEllipsoidModel constructor
+    return obj
+
+class TriaxialEllipsoidModel(CTriaxialEllipsoidModel, BaseComponent):
+    """ 
+    Class that evaluates a TriaxialEllipsoidModel model. 
+    This file was auto-generated from src\sans\models\include\triaxial_ellipsoid.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * semi_axisA      = 35.0 [A]
+    * semi_axisB      = 100.0 [A]
+    * semi_axisC      = 400.0 [A]
+    * sldEll          = 1e-06 [1/A^(2)]
+    * sldSolv         = 6.3e-06 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+    * axis_theta      = 57.325 [deg]
+    * axis_phi        = 57.325 [deg]
+    * axis_psi        = 0.0 [deg]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CTriaxialEllipsoidModel.__init__, (self,)) 
+
+        CTriaxialEllipsoidModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "TriaxialEllipsoidModel"
+        ## Model description
+        self.description = """
+        Note: During fitting ensure that the inequality A<B<C is not
+		violated. Otherwise the calculation will
+		not be correct.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['semi_axisA'] = ['[A]', None, None]
+        self.details['semi_axisB'] = ['[A]', None, None]
+        self.details['semi_axisC'] = ['[A]', None, None]
+        self.details['sldEll'] = ['[1/A^(2)]', None, None]
+        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+        self.details['axis_theta'] = ['[deg]', None, None]
+        self.details['axis_phi'] = ['[deg]', None, None]
+        self.details['axis_psi'] = ['[deg]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['axis_psi.width',
+                      'axis_phi.width',
+                      'axis_theta.width',
+                      'semi_axisA.width',
+                      'semi_axisB.width',
+                      'semi_axisC.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = ['axis_psi',
+                                   'axis_phi',
+                                   'axis_theta',
+                                   'axis_psi.width',
+                                   'axis_phi.width',
+                                   'axis_theta.width']
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_TriaxialEllipsoidModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(TriaxialEllipsoidModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CTriaxialEllipsoidModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CTriaxialEllipsoidModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CTriaxialEllipsoidModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CTriaxialEllipsoidModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CTriaxialEllipsoidModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CTriaxialEllipsoidModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/TwoYukawaModel.py
===================================================================
--- src/sans/models/TwoYukawaModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/TwoYukawaModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,189 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\TwoYukawa.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CTwoYukawaModel
+
+def create_TwoYukawaModel():
+    """
+       Create a model instance
+    """
+    obj = TwoYukawaModel()
+    # CTwoYukawaModel.__init__(obj) is called by
+    # the TwoYukawaModel constructor
+    return obj
+
+class TwoYukawaModel(CTwoYukawaModel, BaseComponent):
+    """ 
+    Class that evaluates a TwoYukawaModel model. 
+    This file was auto-generated from src\sans\models\include\TwoYukawa.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * volfraction     = 0.2 
+    * effect_radius   = 50.0 [A]
+    * scale_K1        = 6.0 
+    * decayConst_Z1   = 10.0 
+    * scale_K2        = -1.0 
+    * decayConst_Z2   = 2.0 
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CTwoYukawaModel.__init__, (self,)) 
+
+        CTwoYukawaModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "TwoYukawaModel"
+        ## Model description
+        self.description = """
+        Structure factor for interacting particles:                   .
+		
+		Calculates the structure factor, S(q), for a monodisperse spherical particle interacting
+		through a two-Yukawa potential. The Mean Spherical Approximation is used as the
+		closure to solve the Ornstein-Zernicke equations.
+		
+		The function calculated is S(q), based on the solution of the Ornstein-Zernicke equations
+		using the Two-Yukawa potential (in its scaled form, r=r/diam):
+		
+		Radius is that of the hard core. The returned value is dimensionless.
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['volfraction'] = ['', None, None]
+        self.details['effect_radius'] = ['[A]', None, None]
+        self.details['scale_K1'] = ['', None, None]
+        self.details['decayConst_Z1'] = ['', None, None]
+        self.details['scale_K2'] = ['', None, None]
+        self.details['decayConst_Z2'] = ['', None, None]
+
+        ## fittable parameters
+        self.fixed = []
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_TwoYukawaModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(TwoYukawaModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CTwoYukawaModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CTwoYukawaModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CTwoYukawaModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CTwoYukawaModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CTwoYukawaModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CTwoYukawaModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/VesicleModel.py
===================================================================
--- src/sans/models/VesicleModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/VesicleModel.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,186 @@
+##############################################################################
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
+#
+# If you use DANSE applications to do scientific research that leads to
+# publication, we ask that you acknowledge the use of the software with the
+# following sentence:
+#
+# This work benefited from DANSE software developed under NSF award DMR-0520547
+#
+# Copyright 2008-2011, University of Tennessee
+##############################################################################
+
+""" 
+Provide functionality for a C extension model
+
+.. WARNING::
+
+   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+   DO NOT MODIFY THIS FILE, MODIFY
+   src\sans\models\include\vesicle.h
+   AND RE-RUN THE GENERATOR SCRIPT
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans.models.sans_extension.c_models import CVesicleModel
+
+def create_VesicleModel():
+    """
+       Create a model instance
+    """
+    obj = VesicleModel()
+    # CVesicleModel.__init__(obj) is called by
+    # the VesicleModel constructor
+    return obj
+
+class VesicleModel(CVesicleModel, BaseComponent):
+    """ 
+    Class that evaluates a VesicleModel model. 
+    This file was auto-generated from src\sans\models\include\vesicle.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    
+    List of default parameters:
+
+    * scale           = 1.0 
+    * radius          = 100.0 [A]
+    * thickness       = 30.0 [A]
+    * solv_sld        = 6.36e-06 [1/A^(2)]
+    * shell_sld       = 5e-07 [1/A^(2)]
+    * background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self, multfactor=1):
+        """ Initialization """
+        self.__dict__ = {}
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        #apply(CVesicleModel.__init__, (self,)) 
+
+        CVesicleModel.__init__(self)
+        self.is_multifunc = False
+		        
+        ## Name of the model
+        self.name = "VesicleModel"
+        ## Model description
+        self.description = """
+        Model parameters:    radius : the core radius of the vesicle
+		thickness: the shell thickness
+		core_sld: the core SLD
+		shell_sld: the shell SLD
+		background: incoherent background
+		scale : scale factor
+        """
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['radius'] = ['[A]', None, None]
+        self.details['thickness'] = ['[A]', None, None]
+        self.details['solv_sld'] = ['[1/A^(2)]', None, None]
+        self.details['shell_sld'] = ['[1/A^(2)]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed = ['radius.width',
+                      'thickness.width']
+        
+        ## non-fittable parameters
+        self.non_fittable = []
+        
+        ## parameters with orientation
+        self.orientation_params = []
+
+        ## parameters with magnetism
+        self.magnetic_params = []
+
+        self.category = None
+        self.multiplicity_info = None
+        
+    def __setstate__(self, state):
+        """
+        restore the state of a model from pickle
+        """
+        self.__dict__, self.params, self.dispersion = state
+        
+    def __reduce_ex__(self, proto):
+        """
+        Overwrite the __reduce_ex__ of PyTypeObject *type call in the init of 
+        c model.
+        """
+        state = (self.__dict__, self.params, self.dispersion)
+        return (create_VesicleModel, tuple(), state, None, None)
+        
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(VesicleModel())   
+       	
+    def run(self, x=0.0):
+        """ 
+        Evaluate the model
+        
+        :param x: input q, or [q,phi]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CVesicleModel.run(self, x)
+   
+    def runXY(self, x=0.0):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q, or [qx, qy]
+        
+        :return: scattering function P(q)
+        
+        """
+        return CVesicleModel.runXY(self, x)
+        
+    def evalDistribution(self, x):
+        """ 
+        Evaluate the model in cartesian coordinates
+        
+        :param x: input q[], or [qx[], qy[]]
+        
+        :return: scattering function P(q[])
+        
+        """
+        return CVesicleModel.evalDistribution(self, x)
+        
+    def calculate_ER(self):
+        """ 
+        Calculate the effective radius for P(q)*S(q)
+        
+        :return: the value of the effective radius
+        
+        """       
+        return CVesicleModel.calculate_ER(self)
+        
+    def calculate_VR(self):
+        """ 
+        Calculate the volf ratio for P(q)*S(q)
+        
+        :return: the value of the volf ratio
+        
+        """       
+        return CVesicleModel.calculate_VR(self)
+              
+    def set_dispersion(self, parameter, dispersion):
+        """
+        Set the dispersion object for a model parameter
+        
+        :param parameter: name of the parameter [string]
+        :param dispersion: dispersion object of type DispersionModel
+        
+        """
+        return CVesicleModel.set_dispersion(self,
+               parameter, dispersion.cdisp)
+        
+   
+# End of file
+
Index: src/sans/models/c_extension/c_models/c_models.cpp
===================================================================
--- src/sans/models/c_extension/c_models/c_models.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/c_models/c_models.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,339 @@
+/** c_models
+ *
+ * Module containing all SANS model extensions
+ *
+ * @author   M.Doucet / UTK
+ */
+#include <Python.h>
+#include <parameters.hh>
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+#include "arrayobject.h"
+
+
+ // adding generated code 
+void addCBarBellModel(PyObject *module); 
+void addCBCCrystalModel(PyObject *module); 
+void addCBinaryHSModel(PyObject *module); 
+void addCCappedCylinderModel(PyObject *module); 
+void addCCoreFourShellModel(PyObject *module); 
+void addCCore2ndMomentModel(PyObject *module); 
+void addCCoreShellModel(PyObject *module); 
+void addCCoreShellBicelleModel(PyObject *module); 
+void addCCoreShellCylinderModel(PyObject *module); 
+void addCCSParallelepipedModel(PyObject *module); 
+void addCCylinderModel(PyObject *module); 
+void addCDABModel(PyObject *module); 
+void addCDiamCylFunc(PyObject *module); 
+void addCDiamEllipFunc(PyObject *module); 
+void addCEllipsoidModel(PyObject *module); 
+void addCEllipticalCylinderModel(PyObject *module); 
+void addCFCCrystalModel(PyObject *module); 
+void addCFlexCylEllipXModel(PyObject *module); 
+void addCFlexibleCylinderModel(PyObject *module); 
+void addCFractalModel(PyObject *module); 
+void addCFractalO_Z(PyObject *module); 
+void addCFuzzySphereModel(PyObject *module); 
+void addCGaussian(PyObject *module); 
+void addCGelFitModel(PyObject *module); 
+void addCHardsphereStructure(PyObject *module); 
+void addCHayterMSAStructure(PyObject *module); 
+void addCHollowCylinderModel(PyObject *module); 
+void addCLamellarModel(PyObject *module); 
+void addCLamellarFFHGModel(PyObject *module); 
+void addCLamellarPCrystalModel(PyObject *module); 
+void addCLamellarPSModel(PyObject *module); 
+void addCLamellarPSHGModel(PyObject *module); 
+void addCLinearPearlsModel(PyObject *module); 
+void addCLogNormal(PyObject *module); 
+void addCLorentzian(PyObject *module); 
+void addCMassFractalModel(PyObject *module); 
+void addCMassSurfaceFractal(PyObject *module); 
+void addCMicelleSphCoreModel(PyObject *module); 
+void addCMultiShellModel(PyObject *module); 
+void addCOnionModel(PyObject *module); 
+void addCParallelepipedModel(PyObject *module); 
+void addCPearlNecklaceModel(PyObject *module); 
+void addCPoly_GaussCoil(PyObject *module); 
+void addCPringlesModel(PyObject *module); 
+void addCRaspBerryModel(PyObject *module); 
+void addCRectangularHollowPrismModel(PyObject *module); 
+void addCRectangularHollowPrismInfThinWallsModel(PyObject *module); 
+void addCRectangularPrismModel(PyObject *module); 
+void addCReflModel(PyObject *module); 
+void addCReflAdvModel(PyObject *module); 
+void addCRPAModel(PyObject *module); 
+void addCSCCrystalModel(PyObject *module); 
+void addCSchulz(PyObject *module); 
+void addCSLDCalFunc(PyObject *module); 
+void addCSphereModel(PyObject *module); 
+void addCSphereSLDModel(PyObject *module); 
+void addCCoreShellEllipsoidModel(PyObject *module); 
+void addCCoreShellEllipsoidXTModel(PyObject *module); 
+void addCSquareWellStructure(PyObject *module); 
+void addCStackedDisksModel(PyObject *module); 
+void addCStarPolymer(PyObject *module); 
+void addCStickyHSStructure(PyObject *module); 
+void addCSurfaceFractalModel(PyObject *module); 
+void addCTeubnerStreyModel(PyObject *module); 
+void addCTriaxialEllipsoidModel(PyObject *module); 
+void addCTwoYukawaModel(PyObject *module); 
+void addCVesicleModel(PyObject *module); 
+ // end generated code 
+
+
+
+extern "C" {
+  void addDisperser(PyObject *module);
+}
+
+/**
+ * Delete a dispersion model object
+ */
+void del_dispersion_model(void *ptr){
+  DispersionModel * disp = static_cast<DispersionModel *>(ptr);
+  delete disp;
+  return;
+}
+
+/**
+ * Create a dispersion model as a python object
+ */
+PyObject * new_dispersion_model(PyObject *, PyObject *args) {
+  DispersionModel *disp = new DispersionModel();
+  return PyCObject_FromVoidPtr(disp, del_dispersion_model);
+}
+
+
+/**
+ * Delete a lognormal dispersion model object
+ */
+void del_lognormal_dispersion(void *ptr){
+  LogNormalDispersion * disp = static_cast<LogNormalDispersion *>(ptr);
+  delete disp;
+  return;
+}
+
+/**
+ * Create a lognormal dispersion model as a python object
+ */
+PyObject * new_lognormal_dispersion(PyObject *, PyObject *args) {
+  LogNormalDispersion *disp = new LogNormalDispersion();
+  return PyCObject_FromVoidPtr(disp, del_lognormal_dispersion);
+}
+
+/**
+ * Delete a gaussian dispersion model object
+ */
+void del_gaussian_dispersion(void *ptr){
+  GaussianDispersion * disp = static_cast<GaussianDispersion *>(ptr);
+  delete disp;
+  return;
+}
+
+/**
+ * Create a gaussian dispersion model as a python object
+ */
+PyObject * new_gaussian_dispersion(PyObject *, PyObject *args) {
+  GaussianDispersion *disp = new GaussianDispersion();
+  return PyCObject_FromVoidPtr(disp, del_gaussian_dispersion);
+}
+
+
+/**
+ * Delete a rectangle dispersion model object
+ */
+void del_rectangle_dispersion(void *ptr){
+  RectangleDispersion * disp = static_cast<RectangleDispersion *>(ptr);
+  delete disp;
+  return;
+}
+
+/**
+ * Create a rectangle dispersion model as a python object
+ */
+PyObject * new_rectangle_dispersion(PyObject *, PyObject *args) {
+  RectangleDispersion *disp = new RectangleDispersion();
+  return PyCObject_FromVoidPtr(disp, del_rectangle_dispersion);
+}
+
+
+/**
+ * Delete a schulz dispersion model object
+ */
+void del_schulz_dispersion(void *ptr){
+  SchulzDispersion * disp = static_cast<SchulzDispersion *>(ptr);
+  delete disp;
+  return;
+}
+/**
+ * Create a schulz dispersion model as a python object
+ */
+PyObject * new_schulz_dispersion(PyObject *, PyObject *args) {
+  SchulzDispersion *disp = new SchulzDispersion();
+  return PyCObject_FromVoidPtr(disp, del_schulz_dispersion);
+}
+
+
+/**
+ * Delete an array dispersion model object
+ */
+void del_array_dispersion(void *ptr){
+  ArrayDispersion * disp = static_cast<ArrayDispersion *>(ptr);
+  delete disp;
+  return;
+}
+
+/**
+ * Create an array dispersion model as a python object
+ */
+PyObject * new_array_dispersion(PyObject *, PyObject *args) {
+  ArrayDispersion *disp = new ArrayDispersion();
+  return PyCObject_FromVoidPtr(disp, del_array_dispersion);
+}
+
+#define INVECTOR(obj,buf,len)										\
+    do { \
+      int err = PyObject_AsReadBuffer(obj, (const void **)(&buf), &len); \
+      if (err < 0) return NULL; \
+      len /= sizeof(*buf); \
+    } while (0)
+
+/**
+ * Sets weights from a numpy array
+ */
+PyObject * set_weights(PyObject *, PyObject *args) {
+  PyObject *val_obj;
+  PyObject *wei_obj;
+  PyObject *disp;
+  Py_ssize_t nval;
+  Py_ssize_t nwei;
+  double *values;
+  double *weights;
+  //int i;
+
+  if (!PyArg_ParseTuple(args, "OOO", &disp, &val_obj, &wei_obj)) return NULL;
+  INVECTOR(val_obj, values, nval);
+  INVECTOR(wei_obj, weights, nwei);
+
+  // Sanity check
+  if(nval!=nwei) return NULL;
+
+  // Set the array pointers
+  void *temp = PyCObject_AsVoidPtr(disp);
+  DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+  dispersion->set_weights(nval, values, weights);
+
+  return Py_BuildValue("i",1);
+}
+
+
+
+/**
+ * Define empty module
+ */
+static PyMethodDef module_methods[] = {
+    {"new_dispersion_model", (PyCFunction)new_dispersion_model     , METH_VARARGS,
+        "Create a new DispersionModel object"},
+        {"new_gaussian_model",   (PyCFunction)new_gaussian_dispersion, METH_VARARGS,
+            "Create a new GaussianDispersion object"},
+            {"new_rectangle_model",   (PyCFunction)new_rectangle_dispersion, METH_VARARGS,
+                "Create a new RectangleDispersion object"},
+                {"new_lognormal_model",   (PyCFunction)new_lognormal_dispersion, METH_VARARGS,
+                    "Create a new LogNormalDispersion object"},
+                    {"new_schulz_model",   (PyCFunction)new_schulz_dispersion, METH_VARARGS,
+                        "Create a new SchulzDispersion object"},
+                        {"new_array_model",      (PyCFunction)new_array_dispersion  , METH_VARARGS,
+                            "Create a new ArrayDispersion object"},
+                            {"set_dispersion_weights",(PyCFunction)set_weights  , METH_VARARGS,
+                                "Create the dispersion weight arrays for an Array Dispersion object"},
+                                {NULL}
+};
+
+
+#ifndef PyMODINIT_FUNC	/* declarations for DLL import/export */
+#define PyMODINIT_FUNC void
+#endif
+PyMODINIT_FUNC
+initc_models(void)
+{
+  PyObject* m;
+
+  m = Py_InitModule3("c_models", module_methods,
+      "C extension module for SANS scattering models.");
+  import_array();
+
+
+ // adding generated code 
+addCBarBellModel(m); 
+addCBCCrystalModel(m); 
+addCBinaryHSModel(m); 
+addCCappedCylinderModel(m); 
+addCCoreFourShellModel(m); 
+addCCore2ndMomentModel(m); 
+addCCoreShellModel(m); 
+addCCoreShellBicelleModel(m); 
+addCCoreShellCylinderModel(m); 
+addCCSParallelepipedModel(m); 
+addCCylinderModel(m); 
+addCDABModel(m); 
+addCDiamCylFunc(m); 
+addCDiamEllipFunc(m); 
+addCEllipsoidModel(m); 
+addCEllipticalCylinderModel(m); 
+addCFCCrystalModel(m); 
+addCFlexCylEllipXModel(m); 
+addCFlexibleCylinderModel(m); 
+addCFractalModel(m); 
+addCFractalO_Z(m); 
+addCFuzzySphereModel(m); 
+addCGaussian(m); 
+addCGelFitModel(m); 
+addCHardsphereStructure(m); 
+addCHayterMSAStructure(m); 
+addCHollowCylinderModel(m); 
+addCLamellarModel(m); 
+addCLamellarFFHGModel(m); 
+addCLamellarPCrystalModel(m); 
+addCLamellarPSModel(m); 
+addCLamellarPSHGModel(m); 
+addCLinearPearlsModel(m); 
+addCLogNormal(m); 
+addCLorentzian(m); 
+addCMassFractalModel(m); 
+addCMassSurfaceFractal(m); 
+addCMicelleSphCoreModel(m); 
+addCMultiShellModel(m); 
+addCOnionModel(m); 
+addCParallelepipedModel(m); 
+addCPearlNecklaceModel(m); 
+addCPoly_GaussCoil(m); 
+addCPringlesModel(m); 
+addCRaspBerryModel(m); 
+addCRectangularHollowPrismModel(m); 
+addCRectangularHollowPrismInfThinWallsModel(m); 
+addCRectangularPrismModel(m); 
+addCReflModel(m); 
+addCReflAdvModel(m); 
+addCRPAModel(m); 
+addCSCCrystalModel(m); 
+addCSchulz(m); 
+addCSLDCalFunc(m); 
+addCSphereModel(m); 
+addCSphereSLDModel(m); 
+addCCoreShellEllipsoidModel(m); 
+addCCoreShellEllipsoidXTModel(m); 
+addCSquareWellStructure(m); 
+addCStackedDisksModel(m); 
+addCStarPolymer(m); 
+addCStickyHSStructure(m); 
+addCSurfaceFractalModel(m); 
+addCTeubnerStreyModel(m); 
+addCTriaxialEllipsoidModel(m); 
+addCTwoYukawaModel(m); 
+addCVesicleModel(m); 
+addDisperser(m); 
+
+ // end generated code 
+
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CBCCrystalModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CBCCrystalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CBCCrystalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,657 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CBCCrystalModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\bcc.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "bcc.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CBCCrystalModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    BCCrystalModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CBCCrystalModel;
+
+
+static void
+CBCCrystalModel_dealloc(CBCCrystalModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CBCCrystalModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CBCCrystalModel *self;
+    
+    self = (CBCCrystalModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CBCCrystalModel_init(CBCCrystalModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new BCCrystalModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"dnn",Py_BuildValue("d",220.000000000000));
+        PyDict_SetItemString(self->params,"sldSph",Py_BuildValue("d",0.000003000000));
+        PyDict_SetItemString(self->params,"d_factor",Py_BuildValue("d",0.060000000000));
+        PyDict_SetItemString(self->params,"psi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",40.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000006300000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->phi.dispersion->accept_as_source(visitor, self->model->phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->psi.dispersion->accept_as_source(visitor, self->model->psi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "psi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->theta.dispersion->accept_as_source(visitor, self->model->theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "theta", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CBCCrystalModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CBCCrystalModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CBCCrystalModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CBCCrystalModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CBCCrystalModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(BCCrystalModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( BCCrystalModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CBCCrystalModelError, 
+                   "CBCCrystalModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CBCCrystalModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CBCCrystalModelError, 
+	    	"CBCCrystalModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CBCCrystalModelError, 
+                   "CBCCrystalModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CBCCrystalModelError, 
+	    		"CBCCrystalModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CBCCrystalModelError, 
+                   "CBCCrystalModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CBCCrystalModelError, 
+                   "CBCCrystalModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CBCCrystalModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CBCCrystalModelError, 
+	    	"CBCCrystalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CBCCrystalModelError, 
+	    		"CBCCrystalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CBCCrystalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CBCCrystalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CBCCrystalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CBCCrystalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CBCCrystalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CBCCrystalModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CBCCrystalModelError, 
+	    	"CBCCrystalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CBCCrystalModelError, 
+	    		"CBCCrystalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CBCCrystalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CBCCrystalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CBCCrystalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CBCCrystalModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CBCCrystalModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CBCCrystalModelError,
+	    	"CBCCrystalModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "phi")) {
+        self->model->phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "psi")) {
+        self->model->psi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "theta")) {
+        self->model->theta.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CBCCrystalModelError,
+	    	"CBCCrystalModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CBCCrystalModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CBCCrystalModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CBCCrystalModel",             /*tp_name*/
+    sizeof(CBCCrystalModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CBCCrystalModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CBCCrystalModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CBCCrystalModel_methods,             /* tp_methods */
+    CBCCrystalModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CBCCrystalModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CBCCrystalModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCBCCrystalModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CBCCrystalModelType) < 0)
+        return;
+
+    Py_INCREF(&CBCCrystalModelType);
+    PyModule_AddObject(module, "CBCCrystalModel", (PyObject *)&CBCCrystalModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CBCCrystalModel.error";
+    CBCCrystalModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CBCCrystalModelError", CBCCrystalModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CBarBellModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CBarBellModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CBarBellModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,666 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CBarBellModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\barbell.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "barbell.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CBarBellModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    BarBellModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CBarBellModel;
+
+
+static void
+CBarBellModel_dealloc(CBarBellModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CBarBellModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CBarBellModel *self;
+    
+    self = (CBarBellModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CBarBellModel_init(CBarBellModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new BarBellModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sld_barbell",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"len_bar",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"rad_bell",Py_BuildValue("d",40.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"rad_bar",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000006300000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->rad_bar.dispersion->accept_as_source(visitor, self->model->rad_bar.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "rad_bar", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->len_bar.dispersion->accept_as_source(visitor, self->model->len_bar.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "len_bar", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->rad_bell.dispersion->accept_as_source(visitor, self->model->rad_bell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "rad_bell", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->phi.dispersion->accept_as_source(visitor, self->model->phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->theta.dispersion->accept_as_source(visitor, self->model->theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "theta", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CBarBellModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CBarBellModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CBarBellModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CBarBellModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CBarBellModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(BarBellModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( BarBellModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CBarBellModelError, 
+                   "CBarBellModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CBarBellModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_barbell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_barbell") );
+    self->model->len_bar = PyFloat_AsDouble( PyDict_GetItemString(self->params, "len_bar") );
+    self->model->rad_bell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_bell") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->rad_bar = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_bar") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_bar");
+    self->model->rad_bar.dispersion->accept_as_destination(visitor, self->model->rad_bar.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "len_bar");
+    self->model->len_bar.dispersion->accept_as_destination(visitor, self->model->len_bar.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_bell");
+    self->model->rad_bell.dispersion->accept_as_destination(visitor, self->model->rad_bell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CBarBellModelError, 
+	    	"CBarBellModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CBarBellModelError, 
+                   "CBarBellModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CBarBellModelError, 
+	    		"CBarBellModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CBarBellModelError, 
+                   "CBarBellModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CBarBellModelError, 
+                   "CBarBellModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CBarBellModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_barbell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_barbell") );
+    self->model->len_bar = PyFloat_AsDouble( PyDict_GetItemString(self->params, "len_bar") );
+    self->model->rad_bell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_bell") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->rad_bar = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_bar") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_bar");
+    self->model->rad_bar.dispersion->accept_as_destination(visitor, self->model->rad_bar.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "len_bar");
+    self->model->len_bar.dispersion->accept_as_destination(visitor, self->model->len_bar.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_bell");
+    self->model->rad_bell.dispersion->accept_as_destination(visitor, self->model->rad_bell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CBarBellModelError, 
+	    	"CBarBellModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CBarBellModelError, 
+	    		"CBarBellModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CBarBellModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CBarBellModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CBarBellModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CBarBellModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_barbell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_barbell") );
+    self->model->len_bar = PyFloat_AsDouble( PyDict_GetItemString(self->params, "len_bar") );
+    self->model->rad_bell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_bell") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->rad_bar = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_bar") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_bar");
+    self->model->rad_bar.dispersion->accept_as_destination(visitor, self->model->rad_bar.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "len_bar");
+    self->model->len_bar.dispersion->accept_as_destination(visitor, self->model->len_bar.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_bell");
+    self->model->rad_bell.dispersion->accept_as_destination(visitor, self->model->rad_bell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CBarBellModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_barbell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_barbell") );
+    self->model->len_bar = PyFloat_AsDouble( PyDict_GetItemString(self->params, "len_bar") );
+    self->model->rad_bell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_bell") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->rad_bar = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_bar") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_bar");
+    self->model->rad_bar.dispersion->accept_as_destination(visitor, self->model->rad_bar.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "len_bar");
+    self->model->len_bar.dispersion->accept_as_destination(visitor, self->model->len_bar.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_bell");
+    self->model->rad_bell.dispersion->accept_as_destination(visitor, self->model->rad_bell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CBarBellModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_barbell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_barbell") );
+    self->model->len_bar = PyFloat_AsDouble( PyDict_GetItemString(self->params, "len_bar") );
+    self->model->rad_bell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_bell") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->rad_bar = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_bar") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_bar");
+    self->model->rad_bar.dispersion->accept_as_destination(visitor, self->model->rad_bar.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "len_bar");
+    self->model->len_bar.dispersion->accept_as_destination(visitor, self->model->len_bar.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_bell");
+    self->model->rad_bell.dispersion->accept_as_destination(visitor, self->model->rad_bell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CBarBellModelError, 
+	    	"CBarBellModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CBarBellModelError, 
+	    		"CBarBellModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CBarBellModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CBarBellModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CBarBellModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CBarBellModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CBarBellModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CBarBellModelError,
+	    	"CBarBellModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "rad_bar")) {
+        self->model->rad_bar.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "len_bar")) {
+        self->model->len_bar.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "rad_bell")) {
+        self->model->rad_bell.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "phi")) {
+        self->model->phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "theta")) {
+        self->model->theta.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CBarBellModelError,
+	    	"CBarBellModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CBarBellModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CBarBellModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CBarBellModel",             /*tp_name*/
+    sizeof(CBarBellModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CBarBellModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CBarBellModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CBarBellModel_methods,             /* tp_methods */
+    CBarBellModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CBarBellModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CBarBellModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCBarBellModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CBarBellModelType) < 0)
+        return;
+
+    Py_INCREF(&CBarBellModelType);
+    PyModule_AddObject(module, "CBarBellModel", (PyObject *)&CBarBellModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CBarBellModel.error";
+    CBarBellModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CBarBellModelError", CBarBellModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CBinaryHSModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CBinaryHSModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CBinaryHSModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,615 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CBinaryHSModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\binaryHS.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "binaryHS.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CBinaryHSModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    BinaryHSModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CBinaryHSModel;
+
+
+static void
+CBinaryHSModel_dealloc(CBinaryHSModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CBinaryHSModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CBinaryHSModel *self;
+    
+    self = (CBinaryHSModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CBinaryHSModel_init(CBinaryHSModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new BinaryHSModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"vol_frac_ls",Py_BuildValue("d",0.100000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000000000));
+        PyDict_SetItemString(self->params,"vol_frac_ss",Py_BuildValue("d",0.200000000000));
+        PyDict_SetItemString(self->params,"solvent_sld",Py_BuildValue("d",0.000006360000));
+        PyDict_SetItemString(self->params,"ls_sld",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"ss_sld",Py_BuildValue("d",0.000000500000));
+        PyDict_SetItemString(self->params,"s_radius",Py_BuildValue("d",25.000000000000));
+        PyDict_SetItemString(self->params,"l_radius",Py_BuildValue("d",100.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->l_radius.dispersion->accept_as_source(visitor, self->model->l_radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "l_radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->s_radius.dispersion->accept_as_source(visitor, self->model->s_radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "s_radius", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CBinaryHSModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CBinaryHSModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CBinaryHSModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CBinaryHSModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CBinaryHSModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(BinaryHSModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( BinaryHSModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CBinaryHSModelError, 
+                   "CBinaryHSModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CBinaryHSModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->ls_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ls_sld") );
+    self->model->ss_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ss_sld") );
+    self->model->s_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_radius") );
+    self->model->l_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "l_radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "l_radius");
+    self->model->l_radius.dispersion->accept_as_destination(visitor, self->model->l_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "s_radius");
+    self->model->s_radius.dispersion->accept_as_destination(visitor, self->model->s_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CBinaryHSModelError, 
+	    	"CBinaryHSModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CBinaryHSModelError, 
+                   "CBinaryHSModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CBinaryHSModelError, 
+	    		"CBinaryHSModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CBinaryHSModelError, 
+                   "CBinaryHSModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CBinaryHSModelError, 
+                   "CBinaryHSModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CBinaryHSModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->ls_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ls_sld") );
+    self->model->ss_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ss_sld") );
+    self->model->s_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_radius") );
+    self->model->l_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "l_radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "l_radius");
+    self->model->l_radius.dispersion->accept_as_destination(visitor, self->model->l_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "s_radius");
+    self->model->s_radius.dispersion->accept_as_destination(visitor, self->model->s_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CBinaryHSModelError, 
+	    	"CBinaryHSModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CBinaryHSModelError, 
+	    		"CBinaryHSModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CBinaryHSModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CBinaryHSModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CBinaryHSModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CBinaryHSModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->ls_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ls_sld") );
+    self->model->ss_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ss_sld") );
+    self->model->s_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_radius") );
+    self->model->l_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "l_radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "l_radius");
+    self->model->l_radius.dispersion->accept_as_destination(visitor, self->model->l_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "s_radius");
+    self->model->s_radius.dispersion->accept_as_destination(visitor, self->model->s_radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CBinaryHSModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->ls_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ls_sld") );
+    self->model->ss_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ss_sld") );
+    self->model->s_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_radius") );
+    self->model->l_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "l_radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "l_radius");
+    self->model->l_radius.dispersion->accept_as_destination(visitor, self->model->l_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "s_radius");
+    self->model->s_radius.dispersion->accept_as_destination(visitor, self->model->s_radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CBinaryHSModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->ls_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ls_sld") );
+    self->model->ss_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ss_sld") );
+    self->model->s_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_radius") );
+    self->model->l_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "l_radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "l_radius");
+    self->model->l_radius.dispersion->accept_as_destination(visitor, self->model->l_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "s_radius");
+    self->model->s_radius.dispersion->accept_as_destination(visitor, self->model->s_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CBinaryHSModelError, 
+	    	"CBinaryHSModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CBinaryHSModelError, 
+	    		"CBinaryHSModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CBinaryHSModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CBinaryHSModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CBinaryHSModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CBinaryHSModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CBinaryHSModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CBinaryHSModelError,
+	    	"CBinaryHSModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "l_radius")) {
+        self->model->l_radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "s_radius")) {
+        self->model->s_radius.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CBinaryHSModelError,
+	    	"CBinaryHSModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CBinaryHSModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CBinaryHSModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CBinaryHSModel",             /*tp_name*/
+    sizeof(CBinaryHSModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CBinaryHSModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CBinaryHSModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CBinaryHSModel_methods,             /* tp_methods */
+    CBinaryHSModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CBinaryHSModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CBinaryHSModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCBinaryHSModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CBinaryHSModelType) < 0)
+        return;
+
+    Py_INCREF(&CBinaryHSModelType);
+    PyModule_AddObject(module, "CBinaryHSModel", (PyObject *)&CBinaryHSModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CBinaryHSModel.error";
+    CBinaryHSModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CBinaryHSModelError", CBinaryHSModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CCSParallelepipedModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CCSParallelepipedModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CCSParallelepipedModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,723 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CCSParallelepipedModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\csparallelepiped.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "csparallelepiped.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CCSParallelepipedModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    CSParallelepipedModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CCSParallelepipedModel;
+
+
+static void
+CCSParallelepipedModel_dealloc(CCSParallelepipedModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CCSParallelepipedModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CCSParallelepipedModel *self;
+    
+    self = (CCSParallelepipedModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CCSParallelepipedModel_init(CCSParallelepipedModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new CSParallelepipedModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"sld_rimB",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_rimC",Py_BuildValue("d",0.000002000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.060000000000));
+        PyDict_SetItemString(self->params,"parallel_psi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"midB",Py_BuildValue("d",75.000000000000));
+        PyDict_SetItemString(self->params,"parallel_theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"parallel_phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_pcore",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"sld_rimA",Py_BuildValue("d",0.000002000000));
+        PyDict_SetItemString(self->params,"shortA",Py_BuildValue("d",35.000000000000));
+        PyDict_SetItemString(self->params,"rimB",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"rimC",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"longC",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000006000000));
+        PyDict_SetItemString(self->params,"rimA",Py_BuildValue("d",10.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->shortA.dispersion->accept_as_source(visitor, self->model->shortA.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "shortA", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->midB.dispersion->accept_as_source(visitor, self->model->midB.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "midB", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->longC.dispersion->accept_as_source(visitor, self->model->longC.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "longC", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->parallel_phi.dispersion->accept_as_source(visitor, self->model->parallel_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "parallel_phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->parallel_psi.dispersion->accept_as_source(visitor, self->model->parallel_psi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "parallel_psi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->parallel_theta.dispersion->accept_as_source(visitor, self->model->parallel_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "parallel_theta", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CCSParallelepipedModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CCSParallelepipedModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CCSParallelepipedModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CCSParallelepipedModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CCSParallelepipedModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(CSParallelepipedModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( CSParallelepipedModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CCSParallelepipedModelError, 
+                   "CCSParallelepipedModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CCSParallelepipedModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_rimB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimB") );
+    self->model->sld_rimC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimC") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
+    self->model->midB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "midB") );
+    self->model->parallel_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_theta") );
+    self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
+    self->model->sld_pcore = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pcore") );
+    self->model->sld_rimA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimA") );
+    self->model->shortA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shortA") );
+    self->model->rimB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimB") );
+    self->model->rimC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimC") );
+    self->model->longC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "longC") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->rimA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimA") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "shortA");
+    self->model->shortA.dispersion->accept_as_destination(visitor, self->model->shortA.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "midB");
+    self->model->midB.dispersion->accept_as_destination(visitor, self->model->midB.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "longC");
+    self->model->longC.dispersion->accept_as_destination(visitor, self->model->longC.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
+    self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
+    self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCSParallelepipedModelError, 
+	    	"CCSParallelepipedModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CCSParallelepipedModelError, 
+                   "CCSParallelepipedModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CCSParallelepipedModelError, 
+	    		"CCSParallelepipedModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CCSParallelepipedModelError, 
+                   "CCSParallelepipedModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CCSParallelepipedModelError, 
+                   "CCSParallelepipedModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CCSParallelepipedModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_rimB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimB") );
+    self->model->sld_rimC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimC") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
+    self->model->midB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "midB") );
+    self->model->parallel_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_theta") );
+    self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
+    self->model->sld_pcore = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pcore") );
+    self->model->sld_rimA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimA") );
+    self->model->shortA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shortA") );
+    self->model->rimB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimB") );
+    self->model->rimC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimC") );
+    self->model->longC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "longC") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->rimA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimA") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "shortA");
+    self->model->shortA.dispersion->accept_as_destination(visitor, self->model->shortA.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "midB");
+    self->model->midB.dispersion->accept_as_destination(visitor, self->model->midB.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "longC");
+    self->model->longC.dispersion->accept_as_destination(visitor, self->model->longC.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
+    self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
+    self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCSParallelepipedModelError, 
+	    	"CCSParallelepipedModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCSParallelepipedModelError, 
+	    		"CCSParallelepipedModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CCSParallelepipedModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CCSParallelepipedModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CCSParallelepipedModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CCSParallelepipedModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_rimB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimB") );
+    self->model->sld_rimC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimC") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
+    self->model->midB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "midB") );
+    self->model->parallel_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_theta") );
+    self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
+    self->model->sld_pcore = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pcore") );
+    self->model->sld_rimA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimA") );
+    self->model->shortA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shortA") );
+    self->model->rimB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimB") );
+    self->model->rimC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimC") );
+    self->model->longC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "longC") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->rimA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimA") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "shortA");
+    self->model->shortA.dispersion->accept_as_destination(visitor, self->model->shortA.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "midB");
+    self->model->midB.dispersion->accept_as_destination(visitor, self->model->midB.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "longC");
+    self->model->longC.dispersion->accept_as_destination(visitor, self->model->longC.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
+    self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
+    self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CCSParallelepipedModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_rimB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimB") );
+    self->model->sld_rimC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimC") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
+    self->model->midB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "midB") );
+    self->model->parallel_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_theta") );
+    self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
+    self->model->sld_pcore = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pcore") );
+    self->model->sld_rimA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimA") );
+    self->model->shortA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shortA") );
+    self->model->rimB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimB") );
+    self->model->rimC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimC") );
+    self->model->longC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "longC") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->rimA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimA") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "shortA");
+    self->model->shortA.dispersion->accept_as_destination(visitor, self->model->shortA.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "midB");
+    self->model->midB.dispersion->accept_as_destination(visitor, self->model->midB.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "longC");
+    self->model->longC.dispersion->accept_as_destination(visitor, self->model->longC.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
+    self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
+    self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CCSParallelepipedModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_rimB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimB") );
+    self->model->sld_rimC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimC") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
+    self->model->midB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "midB") );
+    self->model->parallel_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_theta") );
+    self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
+    self->model->sld_pcore = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pcore") );
+    self->model->sld_rimA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_rimA") );
+    self->model->shortA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shortA") );
+    self->model->rimB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimB") );
+    self->model->rimC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimC") );
+    self->model->longC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "longC") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->rimA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rimA") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "shortA");
+    self->model->shortA.dispersion->accept_as_destination(visitor, self->model->shortA.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "midB");
+    self->model->midB.dispersion->accept_as_destination(visitor, self->model->midB.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "longC");
+    self->model->longC.dispersion->accept_as_destination(visitor, self->model->longC.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
+    self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
+    self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCSParallelepipedModelError, 
+	    	"CCSParallelepipedModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCSParallelepipedModelError, 
+	    		"CCSParallelepipedModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CCSParallelepipedModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CCSParallelepipedModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CCSParallelepipedModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CCSParallelepipedModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CCSParallelepipedModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CCSParallelepipedModelError,
+	    	"CCSParallelepipedModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "shortA")) {
+        self->model->shortA.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "midB")) {
+        self->model->midB.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "longC")) {
+        self->model->longC.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "parallel_phi")) {
+        self->model->parallel_phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "parallel_psi")) {
+        self->model->parallel_psi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "parallel_theta")) {
+        self->model->parallel_theta.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CCSParallelepipedModelError,
+	    	"CCSParallelepipedModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CCSParallelepipedModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CCSParallelepipedModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CCSParallelepipedModel",             /*tp_name*/
+    sizeof(CCSParallelepipedModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CCSParallelepipedModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CCSParallelepipedModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CCSParallelepipedModel_methods,             /* tp_methods */
+    CCSParallelepipedModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CCSParallelepipedModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CCSParallelepipedModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCCSParallelepipedModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CCSParallelepipedModelType) < 0)
+        return;
+
+    Py_INCREF(&CCSParallelepipedModelType);
+    PyModule_AddObject(module, "CCSParallelepipedModel", (PyObject *)&CCSParallelepipedModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CCSParallelepipedModel.error";
+    CCSParallelepipedModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CCSParallelepipedModelError", CCSParallelepipedModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CCappedCylinderModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CCappedCylinderModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CCappedCylinderModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,666 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CCappedCylinderModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\capcyl.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "capcyl.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CCappedCylinderModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    CappedCylinderModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CCappedCylinderModel;
+
+
+static void
+CCappedCylinderModel_dealloc(CCappedCylinderModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CCappedCylinderModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CCappedCylinderModel *self;
+    
+    self = (CCappedCylinderModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CCappedCylinderModel_init(CCappedCylinderModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new CappedCylinderModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"len_cyl",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"sld_capcyl",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"rad_cap",Py_BuildValue("d",40.000000000000));
+        PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000006300000));
+        PyDict_SetItemString(self->params,"rad_cyl",Py_BuildValue("d",20.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->rad_cyl.dispersion->accept_as_source(visitor, self->model->rad_cyl.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "rad_cyl", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->len_cyl.dispersion->accept_as_source(visitor, self->model->len_cyl.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "len_cyl", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->rad_cap.dispersion->accept_as_source(visitor, self->model->rad_cap.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "rad_cap", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->phi.dispersion->accept_as_source(visitor, self->model->phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->theta.dispersion->accept_as_source(visitor, self->model->theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "theta", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CCappedCylinderModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CCappedCylinderModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CCappedCylinderModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CCappedCylinderModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CCappedCylinderModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(CappedCylinderModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( CappedCylinderModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CCappedCylinderModelError, 
+                   "CCappedCylinderModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CCappedCylinderModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->len_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "len_cyl") );
+    self->model->sld_capcyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_capcyl") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->rad_cap = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_cap") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->rad_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_cyl") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_cyl");
+    self->model->rad_cyl.dispersion->accept_as_destination(visitor, self->model->rad_cyl.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "len_cyl");
+    self->model->len_cyl.dispersion->accept_as_destination(visitor, self->model->len_cyl.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_cap");
+    self->model->rad_cap.dispersion->accept_as_destination(visitor, self->model->rad_cap.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCappedCylinderModelError, 
+	    	"CCappedCylinderModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CCappedCylinderModelError, 
+                   "CCappedCylinderModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CCappedCylinderModelError, 
+	    		"CCappedCylinderModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CCappedCylinderModelError, 
+                   "CCappedCylinderModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CCappedCylinderModelError, 
+                   "CCappedCylinderModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CCappedCylinderModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->len_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "len_cyl") );
+    self->model->sld_capcyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_capcyl") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->rad_cap = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_cap") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->rad_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_cyl") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_cyl");
+    self->model->rad_cyl.dispersion->accept_as_destination(visitor, self->model->rad_cyl.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "len_cyl");
+    self->model->len_cyl.dispersion->accept_as_destination(visitor, self->model->len_cyl.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_cap");
+    self->model->rad_cap.dispersion->accept_as_destination(visitor, self->model->rad_cap.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCappedCylinderModelError, 
+	    	"CCappedCylinderModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCappedCylinderModelError, 
+	    		"CCappedCylinderModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CCappedCylinderModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CCappedCylinderModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CCappedCylinderModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CCappedCylinderModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->len_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "len_cyl") );
+    self->model->sld_capcyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_capcyl") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->rad_cap = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_cap") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->rad_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_cyl") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_cyl");
+    self->model->rad_cyl.dispersion->accept_as_destination(visitor, self->model->rad_cyl.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "len_cyl");
+    self->model->len_cyl.dispersion->accept_as_destination(visitor, self->model->len_cyl.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_cap");
+    self->model->rad_cap.dispersion->accept_as_destination(visitor, self->model->rad_cap.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CCappedCylinderModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->len_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "len_cyl") );
+    self->model->sld_capcyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_capcyl") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->rad_cap = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_cap") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->rad_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_cyl") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_cyl");
+    self->model->rad_cyl.dispersion->accept_as_destination(visitor, self->model->rad_cyl.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "len_cyl");
+    self->model->len_cyl.dispersion->accept_as_destination(visitor, self->model->len_cyl.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_cap");
+    self->model->rad_cap.dispersion->accept_as_destination(visitor, self->model->rad_cap.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CCappedCylinderModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->len_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "len_cyl") );
+    self->model->sld_capcyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_capcyl") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->rad_cap = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_cap") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->rad_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_cyl") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_cyl");
+    self->model->rad_cyl.dispersion->accept_as_destination(visitor, self->model->rad_cyl.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "len_cyl");
+    self->model->len_cyl.dispersion->accept_as_destination(visitor, self->model->len_cyl.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_cap");
+    self->model->rad_cap.dispersion->accept_as_destination(visitor, self->model->rad_cap.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCappedCylinderModelError, 
+	    	"CCappedCylinderModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCappedCylinderModelError, 
+	    		"CCappedCylinderModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CCappedCylinderModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CCappedCylinderModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CCappedCylinderModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CCappedCylinderModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CCappedCylinderModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CCappedCylinderModelError,
+	    	"CCappedCylinderModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "rad_cyl")) {
+        self->model->rad_cyl.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "len_cyl")) {
+        self->model->len_cyl.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "rad_cap")) {
+        self->model->rad_cap.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "phi")) {
+        self->model->phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "theta")) {
+        self->model->theta.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CCappedCylinderModelError,
+	    	"CCappedCylinderModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CCappedCylinderModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CCappedCylinderModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CCappedCylinderModel",             /*tp_name*/
+    sizeof(CCappedCylinderModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CCappedCylinderModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CCappedCylinderModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CCappedCylinderModel_methods,             /* tp_methods */
+    CCappedCylinderModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CCappedCylinderModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CCappedCylinderModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCCappedCylinderModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CCappedCylinderModelType) < 0)
+        return;
+
+    Py_INCREF(&CCappedCylinderModelType);
+    PyModule_AddObject(module, "CCappedCylinderModel", (PyObject *)&CCappedCylinderModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CCappedCylinderModel.error";
+    CCappedCylinderModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CCappedCylinderModelError", CCappedCylinderModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CCore2ndMomentModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CCore2ndMomentModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CCore2ndMomentModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,606 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CCore2ndMomentModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\coresecondmoment.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "coresecondmoment.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CCore2ndMomentModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    Core2ndMomentModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CCore2ndMomentModel;
+
+
+static void
+CCore2ndMomentModel_dealloc(CCore2ndMomentModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CCore2ndMomentModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CCore2ndMomentModel *self;
+    
+    self = (CCore2ndMomentModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CCore2ndMomentModel_init(CCore2ndMomentModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new Core2ndMomentModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"second_moment",Py_BuildValue("d",23.000000000000));
+        PyDict_SetItemString(self->params,"density_poly",Py_BuildValue("d",0.700000000000));
+        PyDict_SetItemString(self->params,"ads_amount",Py_BuildValue("d",1.900000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"volf_cores",Py_BuildValue("d",0.140000000000));
+        PyDict_SetItemString(self->params,"radius_core",Py_BuildValue("d",500.000000000000));
+        PyDict_SetItemString(self->params,"sld_poly",Py_BuildValue("d",0.000001500000));
+        PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000006300000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius_core.dispersion->accept_as_source(visitor, self->model->radius_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius_core", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CCore2ndMomentModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CCore2ndMomentModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CCore2ndMomentModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CCore2ndMomentModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CCore2ndMomentModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(Core2ndMomentModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( Core2ndMomentModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CCore2ndMomentModelError, 
+                   "CCore2ndMomentModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CCore2ndMomentModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->second_moment = PyFloat_AsDouble( PyDict_GetItemString(self->params, "second_moment") );
+    self->model->density_poly = PyFloat_AsDouble( PyDict_GetItemString(self->params, "density_poly") );
+    self->model->ads_amount = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ads_amount") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->volf_cores = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_cores") );
+    self->model->radius_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_core") );
+    self->model->sld_poly = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_poly") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_core");
+    self->model->radius_core.dispersion->accept_as_destination(visitor, self->model->radius_core.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCore2ndMomentModelError, 
+	    	"CCore2ndMomentModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CCore2ndMomentModelError, 
+                   "CCore2ndMomentModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CCore2ndMomentModelError, 
+	    		"CCore2ndMomentModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CCore2ndMomentModelError, 
+                   "CCore2ndMomentModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CCore2ndMomentModelError, 
+                   "CCore2ndMomentModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CCore2ndMomentModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->second_moment = PyFloat_AsDouble( PyDict_GetItemString(self->params, "second_moment") );
+    self->model->density_poly = PyFloat_AsDouble( PyDict_GetItemString(self->params, "density_poly") );
+    self->model->ads_amount = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ads_amount") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->volf_cores = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_cores") );
+    self->model->radius_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_core") );
+    self->model->sld_poly = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_poly") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_core");
+    self->model->radius_core.dispersion->accept_as_destination(visitor, self->model->radius_core.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCore2ndMomentModelError, 
+	    	"CCore2ndMomentModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCore2ndMomentModelError, 
+	    		"CCore2ndMomentModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CCore2ndMomentModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CCore2ndMomentModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CCore2ndMomentModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CCore2ndMomentModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->second_moment = PyFloat_AsDouble( PyDict_GetItemString(self->params, "second_moment") );
+    self->model->density_poly = PyFloat_AsDouble( PyDict_GetItemString(self->params, "density_poly") );
+    self->model->ads_amount = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ads_amount") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->volf_cores = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_cores") );
+    self->model->radius_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_core") );
+    self->model->sld_poly = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_poly") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_core");
+    self->model->radius_core.dispersion->accept_as_destination(visitor, self->model->radius_core.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CCore2ndMomentModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->second_moment = PyFloat_AsDouble( PyDict_GetItemString(self->params, "second_moment") );
+    self->model->density_poly = PyFloat_AsDouble( PyDict_GetItemString(self->params, "density_poly") );
+    self->model->ads_amount = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ads_amount") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->volf_cores = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_cores") );
+    self->model->radius_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_core") );
+    self->model->sld_poly = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_poly") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_core");
+    self->model->radius_core.dispersion->accept_as_destination(visitor, self->model->radius_core.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CCore2ndMomentModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->second_moment = PyFloat_AsDouble( PyDict_GetItemString(self->params, "second_moment") );
+    self->model->density_poly = PyFloat_AsDouble( PyDict_GetItemString(self->params, "density_poly") );
+    self->model->ads_amount = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ads_amount") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->volf_cores = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_cores") );
+    self->model->radius_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_core") );
+    self->model->sld_poly = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_poly") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_core");
+    self->model->radius_core.dispersion->accept_as_destination(visitor, self->model->radius_core.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCore2ndMomentModelError, 
+	    	"CCore2ndMomentModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCore2ndMomentModelError, 
+	    		"CCore2ndMomentModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CCore2ndMomentModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CCore2ndMomentModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CCore2ndMomentModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CCore2ndMomentModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CCore2ndMomentModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CCore2ndMomentModelError,
+	    	"CCore2ndMomentModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius_core")) {
+        self->model->radius_core.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CCore2ndMomentModelError,
+	    	"CCore2ndMomentModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CCore2ndMomentModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CCore2ndMomentModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CCore2ndMomentModel",             /*tp_name*/
+    sizeof(CCore2ndMomentModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CCore2ndMomentModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CCore2ndMomentModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CCore2ndMomentModel_methods,             /* tp_methods */
+    CCore2ndMomentModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CCore2ndMomentModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CCore2ndMomentModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCCore2ndMomentModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CCore2ndMomentModelType) < 0)
+        return;
+
+    Py_INCREF(&CCore2ndMomentModelType);
+    PyModule_AddObject(module, "CCore2ndMomentModel", (PyObject *)&CCore2ndMomentModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CCore2ndMomentModel.error";
+    CCore2ndMomentModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CCore2ndMomentModelError", CCore2ndMomentModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CCoreFourShellModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CCoreFourShellModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CCoreFourShellModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,816 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CCoreFourShellModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\corefourshell.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "corefourshell.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CCoreFourShellModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    CoreFourShellModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CCoreFourShellModel;
+
+
+static void
+CCoreFourShellModel_dealloc(CCoreFourShellModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CCoreFourShellModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CCoreFourShellModel *self;
+    
+    self = (CCoreFourShellModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CCoreFourShellModel_init(CCoreFourShellModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new CoreFourShellModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"sld_core0",Py_BuildValue("d",0.000006400000));
+        PyDict_SetItemString(self->params,"Up_frac_i",Py_BuildValue("d",0.500000000000));
+        PyDict_SetItemString(self->params,"Up_frac_f",Py_BuildValue("d",0.500000000000));
+        PyDict_SetItemString(self->params,"rad_core0",Py_BuildValue("d",60.000000000000));
+        PyDict_SetItemString(self->params,"sld_shell3",Py_BuildValue("d",0.000003000000));
+        PyDict_SetItemString(self->params,"Up_theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_shell3",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_core0",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_core0",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thick_shell4",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"sld_shell4",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_shell2",Py_BuildValue("d",0.000002000000));
+        PyDict_SetItemString(self->params,"thick_shell1",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"thick_shell2",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"sld_shell1",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"M_theta_core0",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000000000));
+        PyDict_SetItemString(self->params,"M0_sld_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_theta_shell3",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_theta_shell2",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_theta_shell1",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000006400000));
+        PyDict_SetItemString(self->params,"M_theta_shell4",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_shell2",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_shell3",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_shell1",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_shell4",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_shell4",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_shell3",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_shell2",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_shell1",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_theta_solv",Py_BuildValue("d",0.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->rad_core0.dispersion->accept_as_source(visitor, self->model->rad_core0.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "rad_core0", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell1.dispersion->accept_as_source(visitor, self->model->thick_shell1.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell1", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell2.dispersion->accept_as_source(visitor, self->model->thick_shell2.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell2", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell3.dispersion->accept_as_source(visitor, self->model->thick_shell3.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell3", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell4.dispersion->accept_as_source(visitor, self->model->thick_shell4.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell4", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CCoreFourShellModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CCoreFourShellModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CCoreFourShellModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CCoreFourShellModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CCoreFourShellModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(CoreFourShellModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( CoreFourShellModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CCoreFourShellModelError, 
+                   "CCoreFourShellModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CCoreFourShellModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );
+    self->model->M_phi_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_core0") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->M0_sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_core0") );
+    self->model->thick_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell4") );
+    self->model->sld_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell4") );
+    self->model->sld_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell2") );
+    self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") );
+    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") );
+    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") );
+    self->model->M_theta_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_core0") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->M_theta_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell3") );
+    self->model->M_theta_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell2") );
+    self->model->M_theta_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell1") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->M_theta_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell4") );
+    self->model->M_phi_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell2") );
+    self->model->M_phi_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell3") );
+    self->model->M_phi_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell1") );
+    self->model->M_phi_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell4") );
+    self->model->M0_sld_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell4") );
+    self->model->M0_sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell3") );
+    self->model->M0_sld_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell2") );
+    self->model->M0_sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell1") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1");
+    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell2");
+    self->model->thick_shell2.dispersion->accept_as_destination(visitor, self->model->thick_shell2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell3");
+    self->model->thick_shell3.dispersion->accept_as_destination(visitor, self->model->thick_shell3.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell4");
+    self->model->thick_shell4.dispersion->accept_as_destination(visitor, self->model->thick_shell4.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreFourShellModelError, 
+	    	"CCoreFourShellModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CCoreFourShellModelError, 
+                   "CCoreFourShellModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CCoreFourShellModelError, 
+	    		"CCoreFourShellModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CCoreFourShellModelError, 
+                   "CCoreFourShellModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CCoreFourShellModelError, 
+                   "CCoreFourShellModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CCoreFourShellModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );
+    self->model->M_phi_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_core0") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->M0_sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_core0") );
+    self->model->thick_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell4") );
+    self->model->sld_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell4") );
+    self->model->sld_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell2") );
+    self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") );
+    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") );
+    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") );
+    self->model->M_theta_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_core0") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->M_theta_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell3") );
+    self->model->M_theta_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell2") );
+    self->model->M_theta_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell1") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->M_theta_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell4") );
+    self->model->M_phi_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell2") );
+    self->model->M_phi_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell3") );
+    self->model->M_phi_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell1") );
+    self->model->M_phi_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell4") );
+    self->model->M0_sld_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell4") );
+    self->model->M0_sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell3") );
+    self->model->M0_sld_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell2") );
+    self->model->M0_sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell1") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1");
+    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell2");
+    self->model->thick_shell2.dispersion->accept_as_destination(visitor, self->model->thick_shell2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell3");
+    self->model->thick_shell3.dispersion->accept_as_destination(visitor, self->model->thick_shell3.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell4");
+    self->model->thick_shell4.dispersion->accept_as_destination(visitor, self->model->thick_shell4.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreFourShellModelError, 
+	    	"CCoreFourShellModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCoreFourShellModelError, 
+	    		"CCoreFourShellModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CCoreFourShellModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CCoreFourShellModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CCoreFourShellModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CCoreFourShellModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );
+    self->model->M_phi_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_core0") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->M0_sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_core0") );
+    self->model->thick_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell4") );
+    self->model->sld_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell4") );
+    self->model->sld_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell2") );
+    self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") );
+    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") );
+    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") );
+    self->model->M_theta_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_core0") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->M_theta_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell3") );
+    self->model->M_theta_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell2") );
+    self->model->M_theta_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell1") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->M_theta_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell4") );
+    self->model->M_phi_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell2") );
+    self->model->M_phi_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell3") );
+    self->model->M_phi_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell1") );
+    self->model->M_phi_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell4") );
+    self->model->M0_sld_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell4") );
+    self->model->M0_sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell3") );
+    self->model->M0_sld_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell2") );
+    self->model->M0_sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell1") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1");
+    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell2");
+    self->model->thick_shell2.dispersion->accept_as_destination(visitor, self->model->thick_shell2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell3");
+    self->model->thick_shell3.dispersion->accept_as_destination(visitor, self->model->thick_shell3.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell4");
+    self->model->thick_shell4.dispersion->accept_as_destination(visitor, self->model->thick_shell4.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CCoreFourShellModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );
+    self->model->M_phi_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_core0") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->M0_sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_core0") );
+    self->model->thick_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell4") );
+    self->model->sld_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell4") );
+    self->model->sld_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell2") );
+    self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") );
+    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") );
+    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") );
+    self->model->M_theta_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_core0") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->M_theta_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell3") );
+    self->model->M_theta_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell2") );
+    self->model->M_theta_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell1") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->M_theta_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell4") );
+    self->model->M_phi_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell2") );
+    self->model->M_phi_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell3") );
+    self->model->M_phi_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell1") );
+    self->model->M_phi_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell4") );
+    self->model->M0_sld_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell4") );
+    self->model->M0_sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell3") );
+    self->model->M0_sld_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell2") );
+    self->model->M0_sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell1") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1");
+    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell2");
+    self->model->thick_shell2.dispersion->accept_as_destination(visitor, self->model->thick_shell2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell3");
+    self->model->thick_shell3.dispersion->accept_as_destination(visitor, self->model->thick_shell3.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell4");
+    self->model->thick_shell4.dispersion->accept_as_destination(visitor, self->model->thick_shell4.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CCoreFourShellModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );
+    self->model->M_phi_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_core0") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->M0_sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_core0") );
+    self->model->thick_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell4") );
+    self->model->sld_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell4") );
+    self->model->sld_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell2") );
+    self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") );
+    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") );
+    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") );
+    self->model->M_theta_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_core0") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->M_theta_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell3") );
+    self->model->M_theta_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell2") );
+    self->model->M_theta_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell1") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->M_theta_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell4") );
+    self->model->M_phi_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell2") );
+    self->model->M_phi_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell3") );
+    self->model->M_phi_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell1") );
+    self->model->M_phi_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell4") );
+    self->model->M0_sld_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell4") );
+    self->model->M0_sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell3") );
+    self->model->M0_sld_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell2") );
+    self->model->M0_sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell1") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1");
+    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell2");
+    self->model->thick_shell2.dispersion->accept_as_destination(visitor, self->model->thick_shell2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell3");
+    self->model->thick_shell3.dispersion->accept_as_destination(visitor, self->model->thick_shell3.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell4");
+    self->model->thick_shell4.dispersion->accept_as_destination(visitor, self->model->thick_shell4.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreFourShellModelError, 
+	    	"CCoreFourShellModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCoreFourShellModelError, 
+	    		"CCoreFourShellModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CCoreFourShellModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CCoreFourShellModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CCoreFourShellModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CCoreFourShellModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CCoreFourShellModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CCoreFourShellModelError,
+	    	"CCoreFourShellModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "rad_core0")) {
+        self->model->rad_core0.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell1")) {
+        self->model->thick_shell1.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell2")) {
+        self->model->thick_shell2.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell3")) {
+        self->model->thick_shell3.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell4")) {
+        self->model->thick_shell4.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CCoreFourShellModelError,
+	    	"CCoreFourShellModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CCoreFourShellModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CCoreFourShellModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CCoreFourShellModel",             /*tp_name*/
+    sizeof(CCoreFourShellModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CCoreFourShellModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CCoreFourShellModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CCoreFourShellModel_methods,             /* tp_methods */
+    CCoreFourShellModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CCoreFourShellModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CCoreFourShellModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCCoreFourShellModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CCoreFourShellModelType) < 0)
+        return;
+
+    Py_INCREF(&CCoreFourShellModelType);
+    PyModule_AddObject(module, "CCoreFourShellModel", (PyObject *)&CCoreFourShellModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CCoreFourShellModel.error";
+    CCoreFourShellModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CCoreFourShellModelError", CCoreFourShellModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CCoreShellBicelleModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CCoreShellBicelleModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CCoreShellBicelleModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,699 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CCoreShellBicelleModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\core_shell_bicelle.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "core_shell_bicelle.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CCoreShellBicelleModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    CoreShellBicelleModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CCoreShellBicelleModel;
+
+
+static void
+CCoreShellBicelleModel_dealloc(CCoreShellBicelleModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CCoreShellBicelleModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CCoreShellBicelleModel *self;
+    
+    self = (CCoreShellBicelleModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CCoreShellBicelleModel_init(CCoreShellBicelleModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new CoreShellBicelleModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"rim_sld",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"face_sld",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"face_thick",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",90.000000000000));
+        PyDict_SetItemString(self->params,"solvent_sld",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"rim_thick",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"core_sld",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->rim_thick.dispersion->accept_as_source(visitor, self->model->rim_thick.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "rim_thick", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "length", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->face_thick.dispersion->accept_as_source(visitor, self->model->face_thick.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "face_thick", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_theta.dispersion->accept_as_source(visitor, self->model->axis_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_theta", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_phi.dispersion->accept_as_source(visitor, self->model->axis_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_phi", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CCoreShellBicelleModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CCoreShellBicelleModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CCoreShellBicelleModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CCoreShellBicelleModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CCoreShellBicelleModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(CoreShellBicelleModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( CoreShellBicelleModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CCoreShellBicelleModelError, 
+                   "CCoreShellBicelleModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CCoreShellBicelleModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->rim_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rim_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->face_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "face_sld") );
+    self->model->face_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "face_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->rim_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rim_thick") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rim_thick");
+    self->model->rim_thick.dispersion->accept_as_destination(visitor, self->model->rim_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "face_thick");
+    self->model->face_thick.dispersion->accept_as_destination(visitor, self->model->face_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellBicelleModelError, 
+	    	"CCoreShellBicelleModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CCoreShellBicelleModelError, 
+                   "CCoreShellBicelleModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CCoreShellBicelleModelError, 
+	    		"CCoreShellBicelleModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CCoreShellBicelleModelError, 
+                   "CCoreShellBicelleModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CCoreShellBicelleModelError, 
+                   "CCoreShellBicelleModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CCoreShellBicelleModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->rim_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rim_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->face_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "face_sld") );
+    self->model->face_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "face_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->rim_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rim_thick") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rim_thick");
+    self->model->rim_thick.dispersion->accept_as_destination(visitor, self->model->rim_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "face_thick");
+    self->model->face_thick.dispersion->accept_as_destination(visitor, self->model->face_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellBicelleModelError, 
+	    	"CCoreShellBicelleModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCoreShellBicelleModelError, 
+	    		"CCoreShellBicelleModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CCoreShellBicelleModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CCoreShellBicelleModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CCoreShellBicelleModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CCoreShellBicelleModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->rim_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rim_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->face_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "face_sld") );
+    self->model->face_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "face_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->rim_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rim_thick") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rim_thick");
+    self->model->rim_thick.dispersion->accept_as_destination(visitor, self->model->rim_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "face_thick");
+    self->model->face_thick.dispersion->accept_as_destination(visitor, self->model->face_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CCoreShellBicelleModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->rim_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rim_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->face_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "face_sld") );
+    self->model->face_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "face_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->rim_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rim_thick") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rim_thick");
+    self->model->rim_thick.dispersion->accept_as_destination(visitor, self->model->rim_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "face_thick");
+    self->model->face_thick.dispersion->accept_as_destination(visitor, self->model->face_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CCoreShellBicelleModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->rim_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rim_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->face_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "face_sld") );
+    self->model->face_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "face_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->rim_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rim_thick") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "rim_thick");
+    self->model->rim_thick.dispersion->accept_as_destination(visitor, self->model->rim_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "face_thick");
+    self->model->face_thick.dispersion->accept_as_destination(visitor, self->model->face_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellBicelleModelError, 
+	    	"CCoreShellBicelleModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCoreShellBicelleModelError, 
+	    		"CCoreShellBicelleModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CCoreShellBicelleModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CCoreShellBicelleModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CCoreShellBicelleModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CCoreShellBicelleModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CCoreShellBicelleModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CCoreShellBicelleModelError,
+	    	"CCoreShellBicelleModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "rim_thick")) {
+        self->model->rim_thick.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "length")) {
+        self->model->length.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "face_thick")) {
+        self->model->face_thick.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_theta")) {
+        self->model->axis_theta.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_phi")) {
+        self->model->axis_phi.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CCoreShellBicelleModelError,
+	    	"CCoreShellBicelleModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CCoreShellBicelleModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CCoreShellBicelleModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CCoreShellBicelleModel",             /*tp_name*/
+    sizeof(CCoreShellBicelleModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CCoreShellBicelleModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CCoreShellBicelleModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CCoreShellBicelleModel_methods,             /* tp_methods */
+    CCoreShellBicelleModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CCoreShellBicelleModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CCoreShellBicelleModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCCoreShellBicelleModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CCoreShellBicelleModelType) < 0)
+        return;
+
+    Py_INCREF(&CCoreShellBicelleModelType);
+    PyModule_AddObject(module, "CCoreShellBicelleModel", (PyObject *)&CCoreShellBicelleModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CCoreShellBicelleModel.error";
+    CCoreShellBicelleModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CCoreShellBicelleModelError", CCoreShellBicelleModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CCoreShellCylinderModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CCoreShellCylinderModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CCoreShellCylinderModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,672 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CCoreShellCylinderModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\core_shell_cylinder.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "core_shell_cylinder.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CCoreShellCylinderModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    CoreShellCylinderModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CCoreShellCylinderModel;
+
+
+static void
+CCoreShellCylinderModel_dealloc(CCoreShellCylinderModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CCoreShellCylinderModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CCoreShellCylinderModel *self;
+    
+    self = (CCoreShellCylinderModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CCoreShellCylinderModel_init(CCoreShellCylinderModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new CoreShellCylinderModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",90.000000000000));
+        PyDict_SetItemString(self->params,"solvent_sld",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"thickness",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"core_sld",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"shell_sld",Py_BuildValue("d",0.000004000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thickness.dispersion->accept_as_source(visitor, self->model->thickness.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thickness", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "length", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_theta.dispersion->accept_as_source(visitor, self->model->axis_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_theta", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_phi.dispersion->accept_as_source(visitor, self->model->axis_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_phi", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CCoreShellCylinderModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CCoreShellCylinderModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CCoreShellCylinderModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CCoreShellCylinderModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CCoreShellCylinderModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(CoreShellCylinderModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( CoreShellCylinderModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CCoreShellCylinderModelError, 
+                   "CCoreShellCylinderModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CCoreShellCylinderModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellCylinderModelError, 
+	    	"CCoreShellCylinderModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CCoreShellCylinderModelError, 
+                   "CCoreShellCylinderModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CCoreShellCylinderModelError, 
+	    		"CCoreShellCylinderModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CCoreShellCylinderModelError, 
+                   "CCoreShellCylinderModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CCoreShellCylinderModelError, 
+                   "CCoreShellCylinderModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CCoreShellCylinderModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellCylinderModelError, 
+	    	"CCoreShellCylinderModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCoreShellCylinderModelError, 
+	    		"CCoreShellCylinderModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CCoreShellCylinderModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CCoreShellCylinderModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CCoreShellCylinderModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CCoreShellCylinderModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CCoreShellCylinderModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CCoreShellCylinderModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellCylinderModelError, 
+	    	"CCoreShellCylinderModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCoreShellCylinderModelError, 
+	    		"CCoreShellCylinderModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CCoreShellCylinderModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CCoreShellCylinderModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CCoreShellCylinderModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CCoreShellCylinderModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CCoreShellCylinderModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CCoreShellCylinderModelError,
+	    	"CCoreShellCylinderModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thickness")) {
+        self->model->thickness.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "length")) {
+        self->model->length.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_theta")) {
+        self->model->axis_theta.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_phi")) {
+        self->model->axis_phi.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CCoreShellCylinderModelError,
+	    	"CCoreShellCylinderModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CCoreShellCylinderModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CCoreShellCylinderModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CCoreShellCylinderModel",             /*tp_name*/
+    sizeof(CCoreShellCylinderModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CCoreShellCylinderModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CCoreShellCylinderModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CCoreShellCylinderModel_methods,             /* tp_methods */
+    CCoreShellCylinderModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CCoreShellCylinderModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CCoreShellCylinderModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCCoreShellCylinderModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CCoreShellCylinderModelType) < 0)
+        return;
+
+    Py_INCREF(&CCoreShellCylinderModelType);
+    PyModule_AddObject(module, "CCoreShellCylinderModel", (PyObject *)&CCoreShellCylinderModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CCoreShellCylinderModel.error";
+    CCoreShellCylinderModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CCoreShellCylinderModelError", CCoreShellCylinderModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CCoreShellEllipsoidModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CCoreShellEllipsoidModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CCoreShellEllipsoidModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,693 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CCoreShellEllipsoidModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\spheroid.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "spheroid.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CCoreShellEllipsoidModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    CoreShellEllipsoidModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CCoreShellEllipsoidModel;
+
+
+static void
+CCoreShellEllipsoidModel_dealloc(CCoreShellEllipsoidModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CCoreShellEllipsoidModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CCoreShellEllipsoidModel *self;
+    
+    self = (CCoreShellEllipsoidModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CCoreShellEllipsoidModel_init(CCoreShellEllipsoidModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new CoreShellEllipsoidModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sld_core",Py_BuildValue("d",0.000002000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"polar_shell",Py_BuildValue("d",30.000000000000));
+        PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006300000));
+        PyDict_SetItemString(self->params,"equat_shell",Py_BuildValue("d",250.000000000000));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000000000));
+        PyDict_SetItemString(self->params,"equat_core",Py_BuildValue("d",200.000000000000));
+        PyDict_SetItemString(self->params,"polar_core",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"sld_shell",Py_BuildValue("d",0.000001000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->equat_core.dispersion->accept_as_source(visitor, self->model->equat_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "equat_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->polar_core.dispersion->accept_as_source(visitor, self->model->polar_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "polar_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->equat_shell.dispersion->accept_as_source(visitor, self->model->equat_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "equat_shell", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->polar_shell.dispersion->accept_as_source(visitor, self->model->polar_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "polar_shell", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_phi.dispersion->accept_as_source(visitor, self->model->axis_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_theta.dispersion->accept_as_source(visitor, self->model->axis_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_theta", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CCoreShellEllipsoidModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CCoreShellEllipsoidModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CCoreShellEllipsoidModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CCoreShellEllipsoidModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CCoreShellEllipsoidModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(CoreShellEllipsoidModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( CoreShellEllipsoidModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CCoreShellEllipsoidModelError, 
+                   "CCoreShellEllipsoidModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CCoreShellEllipsoidModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->polar_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_shell") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->equat_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->polar_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_core") );
+    self->model->sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_core");
+    self->model->polar_core.dispersion->accept_as_destination(visitor, self->model->polar_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_shell");
+    self->model->equat_shell.dispersion->accept_as_destination(visitor, self->model->equat_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_shell");
+    self->model->polar_shell.dispersion->accept_as_destination(visitor, self->model->polar_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellEllipsoidModelError, 
+	    	"CCoreShellEllipsoidModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CCoreShellEllipsoidModelError, 
+                   "CCoreShellEllipsoidModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CCoreShellEllipsoidModelError, 
+	    		"CCoreShellEllipsoidModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CCoreShellEllipsoidModelError, 
+                   "CCoreShellEllipsoidModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CCoreShellEllipsoidModelError, 
+                   "CCoreShellEllipsoidModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CCoreShellEllipsoidModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->polar_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_shell") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->equat_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->polar_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_core") );
+    self->model->sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_core");
+    self->model->polar_core.dispersion->accept_as_destination(visitor, self->model->polar_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_shell");
+    self->model->equat_shell.dispersion->accept_as_destination(visitor, self->model->equat_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_shell");
+    self->model->polar_shell.dispersion->accept_as_destination(visitor, self->model->polar_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellEllipsoidModelError, 
+	    	"CCoreShellEllipsoidModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCoreShellEllipsoidModelError, 
+	    		"CCoreShellEllipsoidModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CCoreShellEllipsoidModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CCoreShellEllipsoidModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CCoreShellEllipsoidModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CCoreShellEllipsoidModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->polar_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_shell") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->equat_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->polar_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_core") );
+    self->model->sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_core");
+    self->model->polar_core.dispersion->accept_as_destination(visitor, self->model->polar_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_shell");
+    self->model->equat_shell.dispersion->accept_as_destination(visitor, self->model->equat_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_shell");
+    self->model->polar_shell.dispersion->accept_as_destination(visitor, self->model->polar_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CCoreShellEllipsoidModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->polar_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_shell") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->equat_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->polar_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_core") );
+    self->model->sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_core");
+    self->model->polar_core.dispersion->accept_as_destination(visitor, self->model->polar_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_shell");
+    self->model->equat_shell.dispersion->accept_as_destination(visitor, self->model->equat_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_shell");
+    self->model->polar_shell.dispersion->accept_as_destination(visitor, self->model->polar_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CCoreShellEllipsoidModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->polar_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_shell") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->equat_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->polar_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "polar_core") );
+    self->model->sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_core");
+    self->model->polar_core.dispersion->accept_as_destination(visitor, self->model->polar_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_shell");
+    self->model->equat_shell.dispersion->accept_as_destination(visitor, self->model->equat_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "polar_shell");
+    self->model->polar_shell.dispersion->accept_as_destination(visitor, self->model->polar_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellEllipsoidModelError, 
+	    	"CCoreShellEllipsoidModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCoreShellEllipsoidModelError, 
+	    		"CCoreShellEllipsoidModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CCoreShellEllipsoidModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CCoreShellEllipsoidModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CCoreShellEllipsoidModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CCoreShellEllipsoidModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CCoreShellEllipsoidModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CCoreShellEllipsoidModelError,
+	    	"CCoreShellEllipsoidModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "equat_core")) {
+        self->model->equat_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "polar_core")) {
+        self->model->polar_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "equat_shell")) {
+        self->model->equat_shell.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "polar_shell")) {
+        self->model->polar_shell.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_phi")) {
+        self->model->axis_phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_theta")) {
+        self->model->axis_theta.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CCoreShellEllipsoidModelError,
+	    	"CCoreShellEllipsoidModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CCoreShellEllipsoidModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CCoreShellEllipsoidModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CCoreShellEllipsoidModel",             /*tp_name*/
+    sizeof(CCoreShellEllipsoidModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CCoreShellEllipsoidModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CCoreShellEllipsoidModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CCoreShellEllipsoidModel_methods,             /* tp_methods */
+    CCoreShellEllipsoidModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CCoreShellEllipsoidModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CCoreShellEllipsoidModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCCoreShellEllipsoidModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CCoreShellEllipsoidModelType) < 0)
+        return;
+
+    Py_INCREF(&CCoreShellEllipsoidModelType);
+    PyModule_AddObject(module, "CCoreShellEllipsoidModel", (PyObject *)&CCoreShellEllipsoidModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CCoreShellEllipsoidModel.error";
+    CCoreShellEllipsoidModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CCoreShellEllipsoidModelError", CCoreShellEllipsoidModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CCoreShellEllipsoidXTModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CCoreShellEllipsoidXTModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CCoreShellEllipsoidXTModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,693 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CCoreShellEllipsoidXTModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\spheroidXT.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "spheroidXT.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CCoreShellEllipsoidXTModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    CoreShellEllipsoidXTModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CCoreShellEllipsoidXTModel;
+
+
+static void
+CCoreShellEllipsoidXTModel_dealloc(CCoreShellEllipsoidXTModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CCoreShellEllipsoidXTModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CCoreShellEllipsoidXTModel *self;
+    
+    self = (CCoreShellEllipsoidXTModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CCoreShellEllipsoidXTModel_init(CCoreShellEllipsoidXTModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new CoreShellEllipsoidXTModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",0.050000000000));
+        PyDict_SetItemString(self->params,"sld_core",Py_BuildValue("d",0.000002000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"X_core",Py_BuildValue("d",3.000000000000));
+        PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006300000));
+        PyDict_SetItemString(self->params,"T_shell",Py_BuildValue("d",30.000000000000));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000000000));
+        PyDict_SetItemString(self->params,"equat_core",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"XpolarShell",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sld_shell",Py_BuildValue("d",0.000001000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->equat_core.dispersion->accept_as_source(visitor, self->model->equat_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "equat_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->X_core.dispersion->accept_as_source(visitor, self->model->X_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "X_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->T_shell.dispersion->accept_as_source(visitor, self->model->T_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "T_shell", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->XpolarShell.dispersion->accept_as_source(visitor, self->model->XpolarShell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "XpolarShell", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_phi.dispersion->accept_as_source(visitor, self->model->axis_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_theta.dispersion->accept_as_source(visitor, self->model->axis_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_theta", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CCoreShellEllipsoidXTModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CCoreShellEllipsoidXTModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CCoreShellEllipsoidXTModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CCoreShellEllipsoidXTModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CCoreShellEllipsoidXTModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(CoreShellEllipsoidXTModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( CoreShellEllipsoidXTModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CCoreShellEllipsoidXTModelError, 
+                   "CCoreShellEllipsoidXTModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CCoreShellEllipsoidXTModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->X_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "X_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->T_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "T_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->XpolarShell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "XpolarShell") );
+    self->model->sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "X_core");
+    self->model->X_core.dispersion->accept_as_destination(visitor, self->model->X_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "T_shell");
+    self->model->T_shell.dispersion->accept_as_destination(visitor, self->model->T_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "XpolarShell");
+    self->model->XpolarShell.dispersion->accept_as_destination(visitor, self->model->XpolarShell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellEllipsoidXTModelError, 
+	    	"CCoreShellEllipsoidXTModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CCoreShellEllipsoidXTModelError, 
+                   "CCoreShellEllipsoidXTModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CCoreShellEllipsoidXTModelError, 
+	    		"CCoreShellEllipsoidXTModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CCoreShellEllipsoidXTModelError, 
+                   "CCoreShellEllipsoidXTModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CCoreShellEllipsoidXTModelError, 
+                   "CCoreShellEllipsoidXTModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CCoreShellEllipsoidXTModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->X_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "X_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->T_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "T_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->XpolarShell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "XpolarShell") );
+    self->model->sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "X_core");
+    self->model->X_core.dispersion->accept_as_destination(visitor, self->model->X_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "T_shell");
+    self->model->T_shell.dispersion->accept_as_destination(visitor, self->model->T_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "XpolarShell");
+    self->model->XpolarShell.dispersion->accept_as_destination(visitor, self->model->XpolarShell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellEllipsoidXTModelError, 
+	    	"CCoreShellEllipsoidXTModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCoreShellEllipsoidXTModelError, 
+	    		"CCoreShellEllipsoidXTModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CCoreShellEllipsoidXTModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CCoreShellEllipsoidXTModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CCoreShellEllipsoidXTModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CCoreShellEllipsoidXTModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->X_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "X_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->T_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "T_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->XpolarShell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "XpolarShell") );
+    self->model->sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "X_core");
+    self->model->X_core.dispersion->accept_as_destination(visitor, self->model->X_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "T_shell");
+    self->model->T_shell.dispersion->accept_as_destination(visitor, self->model->T_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "XpolarShell");
+    self->model->XpolarShell.dispersion->accept_as_destination(visitor, self->model->XpolarShell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CCoreShellEllipsoidXTModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->X_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "X_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->T_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "T_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->XpolarShell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "XpolarShell") );
+    self->model->sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "X_core");
+    self->model->X_core.dispersion->accept_as_destination(visitor, self->model->X_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "T_shell");
+    self->model->T_shell.dispersion->accept_as_destination(visitor, self->model->T_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "XpolarShell");
+    self->model->XpolarShell.dispersion->accept_as_destination(visitor, self->model->XpolarShell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CCoreShellEllipsoidXTModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->X_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "X_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->T_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "T_shell") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->equat_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "equat_core") );
+    self->model->XpolarShell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "XpolarShell") );
+    self->model->sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "equat_core");
+    self->model->equat_core.dispersion->accept_as_destination(visitor, self->model->equat_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "X_core");
+    self->model->X_core.dispersion->accept_as_destination(visitor, self->model->X_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "T_shell");
+    self->model->T_shell.dispersion->accept_as_destination(visitor, self->model->T_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "XpolarShell");
+    self->model->XpolarShell.dispersion->accept_as_destination(visitor, self->model->XpolarShell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellEllipsoidXTModelError, 
+	    	"CCoreShellEllipsoidXTModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCoreShellEllipsoidXTModelError, 
+	    		"CCoreShellEllipsoidXTModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CCoreShellEllipsoidXTModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CCoreShellEllipsoidXTModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CCoreShellEllipsoidXTModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CCoreShellEllipsoidXTModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CCoreShellEllipsoidXTModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CCoreShellEllipsoidXTModelError,
+	    	"CCoreShellEllipsoidXTModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "equat_core")) {
+        self->model->equat_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "X_core")) {
+        self->model->X_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "T_shell")) {
+        self->model->T_shell.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "XpolarShell")) {
+        self->model->XpolarShell.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_phi")) {
+        self->model->axis_phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_theta")) {
+        self->model->axis_theta.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CCoreShellEllipsoidXTModelError,
+	    	"CCoreShellEllipsoidXTModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CCoreShellEllipsoidXTModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CCoreShellEllipsoidXTModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CCoreShellEllipsoidXTModel",             /*tp_name*/
+    sizeof(CCoreShellEllipsoidXTModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CCoreShellEllipsoidXTModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CCoreShellEllipsoidXTModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CCoreShellEllipsoidXTModel_methods,             /* tp_methods */
+    CCoreShellEllipsoidXTModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CCoreShellEllipsoidXTModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CCoreShellEllipsoidXTModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCCoreShellEllipsoidXTModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CCoreShellEllipsoidXTModelType) < 0)
+        return;
+
+    Py_INCREF(&CCoreShellEllipsoidXTModelType);
+    PyModule_AddObject(module, "CCoreShellEllipsoidXTModel", (PyObject *)&CCoreShellEllipsoidXTModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CCoreShellEllipsoidXTModel.error";
+    CCoreShellEllipsoidXTModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CCoreShellEllipsoidXTModelError", CCoreShellEllipsoidXTModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CCoreShellModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CCoreShellModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CCoreShellModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,681 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CCoreShellModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\core_shell.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "core_shell.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CCoreShellModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    CoreShellModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CCoreShellModel;
+
+
+static void
+CCoreShellModel_dealloc(CCoreShellModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CCoreShellModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CCoreShellModel *self;
+    
+    self = (CCoreShellModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CCoreShellModel_init(CCoreShellModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new CoreShellModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"Up_frac_i",Py_BuildValue("d",0.500000000000));
+        PyDict_SetItemString(self->params,"M_phi_shell",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"Up_theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"core_sld",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"M_theta_core",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_shell",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_theta_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_core",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thickness",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"solvent_sld",Py_BuildValue("d",0.000003000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",60.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"Up_frac_f",Py_BuildValue("d",0.500000000000));
+        PyDict_SetItemString(self->params,"M_theta_shell",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_core",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"shell_sld",Py_BuildValue("d",0.000002000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thickness.dispersion->accept_as_source(visitor, self->model->thickness.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thickness", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CCoreShellModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CCoreShellModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CCoreShellModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CCoreShellModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CCoreShellModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(CoreShellModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( CoreShellModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CCoreShellModelError, 
+                   "CCoreShellModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CCoreShellModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->M_phi_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->M_theta_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_core") );
+    self->model->M0_sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->M0_sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_core") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->M_theta_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell") );
+    self->model->M_phi_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_core") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellModelError, 
+	    	"CCoreShellModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CCoreShellModelError, 
+                   "CCoreShellModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CCoreShellModelError, 
+	    		"CCoreShellModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CCoreShellModelError, 
+                   "CCoreShellModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CCoreShellModelError, 
+                   "CCoreShellModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CCoreShellModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->M_phi_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->M_theta_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_core") );
+    self->model->M0_sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->M0_sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_core") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->M_theta_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell") );
+    self->model->M_phi_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_core") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellModelError, 
+	    	"CCoreShellModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCoreShellModelError, 
+	    		"CCoreShellModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CCoreShellModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CCoreShellModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CCoreShellModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CCoreShellModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->M_phi_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->M_theta_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_core") );
+    self->model->M0_sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->M0_sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_core") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->M_theta_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell") );
+    self->model->M_phi_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_core") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CCoreShellModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->M_phi_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->M_theta_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_core") );
+    self->model->M0_sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->M0_sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_core") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->M_theta_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell") );
+    self->model->M_phi_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_core") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CCoreShellModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->M_phi_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_shell") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->M_theta_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_core") );
+    self->model->M0_sld_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_shell") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->M0_sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_core") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->M_theta_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_shell") );
+    self->model->M_phi_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_core") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCoreShellModelError, 
+	    	"CCoreShellModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCoreShellModelError, 
+	    		"CCoreShellModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CCoreShellModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CCoreShellModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CCoreShellModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CCoreShellModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CCoreShellModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CCoreShellModelError,
+	    	"CCoreShellModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thickness")) {
+        self->model->thickness.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CCoreShellModelError,
+	    	"CCoreShellModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CCoreShellModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CCoreShellModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CCoreShellModel",             /*tp_name*/
+    sizeof(CCoreShellModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CCoreShellModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CCoreShellModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CCoreShellModel_methods,             /* tp_methods */
+    CCoreShellModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CCoreShellModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CCoreShellModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCCoreShellModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CCoreShellModelType) < 0)
+        return;
+
+    Py_INCREF(&CCoreShellModelType);
+    PyModule_AddObject(module, "CCoreShellModel", (PyObject *)&CCoreShellModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CCoreShellModel.error";
+    CCoreShellModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CCoreShellModelError", CCoreShellModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CCylinderModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CCylinderModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CCylinderModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,699 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CCylinderModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\cylinder.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "cylinder.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CCylinderModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    CylinderModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CCylinderModel;
+
+
+static void
+CCylinderModel_dealloc(CCylinderModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CCylinderModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CCylinderModel *self;
+    
+    self = (CCylinderModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CCylinderModel_init(CCylinderModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new CylinderModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"Up_frac_i",Py_BuildValue("d",0.500000000000));
+        PyDict_SetItemString(self->params,"Up_theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_cyl",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldCyl",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"M0_sld_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_theta_cyl",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"cyl_theta",Py_BuildValue("d",60.000000000000));
+        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_cyl",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"Up_frac_f",Py_BuildValue("d",0.500000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"M_theta_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"cyl_phi",Py_BuildValue("d",60.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "length", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->cyl_theta.dispersion->accept_as_source(visitor, self->model->cyl_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "cyl_theta", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->cyl_phi.dispersion->accept_as_source(visitor, self->model->cyl_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "cyl_phi", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CCylinderModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CCylinderModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CCylinderModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CCylinderModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CCylinderModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(CylinderModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( CylinderModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CCylinderModelError, 
+                   "CCylinderModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CCylinderModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->M0_sld_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_cyl") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->M_theta_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_cyl") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->cyl_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_theta") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M_phi_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_cyl") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->cyl_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_phi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_theta");
+    self->model->cyl_theta.dispersion->accept_as_destination(visitor, self->model->cyl_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_phi");
+    self->model->cyl_phi.dispersion->accept_as_destination(visitor, self->model->cyl_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCylinderModelError, 
+	    	"CCylinderModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CCylinderModelError, 
+                   "CCylinderModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CCylinderModelError, 
+	    		"CCylinderModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CCylinderModelError, 
+                   "CCylinderModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CCylinderModelError, 
+                   "CCylinderModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CCylinderModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->M0_sld_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_cyl") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->M_theta_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_cyl") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->cyl_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_theta") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M_phi_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_cyl") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->cyl_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_phi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_theta");
+    self->model->cyl_theta.dispersion->accept_as_destination(visitor, self->model->cyl_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_phi");
+    self->model->cyl_phi.dispersion->accept_as_destination(visitor, self->model->cyl_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCylinderModelError, 
+	    	"CCylinderModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCylinderModelError, 
+	    		"CCylinderModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CCylinderModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CCylinderModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CCylinderModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CCylinderModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->M0_sld_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_cyl") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->M_theta_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_cyl") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->cyl_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_theta") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M_phi_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_cyl") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->cyl_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_phi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_theta");
+    self->model->cyl_theta.dispersion->accept_as_destination(visitor, self->model->cyl_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_phi");
+    self->model->cyl_phi.dispersion->accept_as_destination(visitor, self->model->cyl_phi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CCylinderModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->M0_sld_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_cyl") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->M_theta_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_cyl") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->cyl_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_theta") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M_phi_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_cyl") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->cyl_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_phi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_theta");
+    self->model->cyl_theta.dispersion->accept_as_destination(visitor, self->model->cyl_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_phi");
+    self->model->cyl_phi.dispersion->accept_as_destination(visitor, self->model->cyl_phi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CCylinderModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->M0_sld_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_cyl") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->M_theta_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_cyl") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->cyl_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_theta") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M_phi_cyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_cyl") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->cyl_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_phi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_theta");
+    self->model->cyl_theta.dispersion->accept_as_destination(visitor, self->model->cyl_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_phi");
+    self->model->cyl_phi.dispersion->accept_as_destination(visitor, self->model->cyl_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CCylinderModelError, 
+	    	"CCylinderModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CCylinderModelError, 
+	    		"CCylinderModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CCylinderModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CCylinderModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CCylinderModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CCylinderModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CCylinderModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CCylinderModelError,
+	    	"CCylinderModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "length")) {
+        self->model->length.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "cyl_theta")) {
+        self->model->cyl_theta.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "cyl_phi")) {
+        self->model->cyl_phi.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CCylinderModelError,
+	    	"CCylinderModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CCylinderModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CCylinderModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CCylinderModel",             /*tp_name*/
+    sizeof(CCylinderModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CCylinderModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CCylinderModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CCylinderModel_methods,             /* tp_methods */
+    CCylinderModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CCylinderModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CCylinderModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCCylinderModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CCylinderModelType) < 0)
+        return;
+
+    Py_INCREF(&CCylinderModelType);
+    PyModule_AddObject(module, "CCylinderModel", (PyObject *)&CCylinderModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CCylinderModel.error";
+    CCylinderModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CCylinderModelError", CCylinderModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CDABModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CDABModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CDABModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,600 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CDABModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\dabmodel.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "dabmodel.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CDABModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    DABModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CDABModel;
+
+
+static void
+CDABModel_dealloc(CDABModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CDABModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CDABModel *self;
+    
+    self = (CDABModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CDABModel_init(CDABModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new DABModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "length", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->scale.dispersion->accept_as_source(visitor, self->model->scale.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "scale", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->background.dispersion->accept_as_source(visitor, self->model->background.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "background", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CDABModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CDABModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CDABModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CDABModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CDABModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(DABModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( DABModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CDABModelError, 
+                   "CDABModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CDABModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CDABModelError, 
+	    	"CDABModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CDABModelError, 
+                   "CDABModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CDABModelError, 
+	    		"CDABModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CDABModelError, 
+                   "CDABModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CDABModelError, 
+                   "CDABModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CDABModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CDABModelError, 
+	    	"CDABModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CDABModelError, 
+	    		"CDABModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CDABModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CDABModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CDABModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CDABModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CDABModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CDABModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CDABModelError, 
+	    	"CDABModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CDABModelError, 
+	    		"CDABModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CDABModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CDABModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CDABModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CDABModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CDABModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CDABModelError,
+	    	"CDABModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "length")) {
+        self->model->length.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "scale")) {
+        self->model->scale.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "background")) {
+        self->model->background.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CDABModelError,
+	    	"CDABModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CDABModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CDABModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CDABModel",             /*tp_name*/
+    sizeof(CDABModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CDABModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CDABModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CDABModel_methods,             /* tp_methods */
+    CDABModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CDABModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CDABModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCDABModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CDABModelType) < 0)
+        return;
+
+    Py_INCREF(&CDABModelType);
+    PyModule_AddObject(module, "CDABModel", (PyObject *)&CDABModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CDABModel.error";
+    CDABModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CDABModelError", CDABModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CDiamCylFunc.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CDiamCylFunc.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CDiamCylFunc.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,579 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CDiamCylFunc
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\DiamCyl.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "DiamCyl.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CDiamCylFuncError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    DiamCylFunc * model;
+    /// Log for unit testing
+    PyObject * log;
+} CDiamCylFunc;
+
+
+static void
+CDiamCylFunc_dealloc(CDiamCylFunc* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CDiamCylFunc_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CDiamCylFunc *self;
+    
+    self = (CDiamCylFunc *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CDiamCylFunc_init(CDiamCylFunc *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new DiamCylFunc();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",20.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "length", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CDiamCylFunc_members[] = {
+    {name_params, T_OBJECT, offsetof(CDiamCylFunc, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CDiamCylFunc, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CDiamCylFunc, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CDiamCylFunc_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(DiamCylFunc* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( DiamCylFunc* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CDiamCylFuncError, 
+                   "CDiamCylFunc.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CDiamCylFunc *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CDiamCylFuncError, 
+	    	"CDiamCylFunc.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CDiamCylFuncError, 
+                   "CDiamCylFunc.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CDiamCylFuncError, 
+	    		"CDiamCylFunc.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CDiamCylFuncError, 
+                   "CDiamCylFunc.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CDiamCylFuncError, 
+                   "CDiamCylFunc.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CDiamCylFunc *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CDiamCylFuncError, 
+	    	"CDiamCylFunc.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CDiamCylFuncError, 
+	    		"CDiamCylFunc.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CDiamCylFunc_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CDiamCylFunc_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CDiamCylFunc_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CDiamCylFunc *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CDiamCylFunc *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CDiamCylFunc *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CDiamCylFuncError, 
+	    	"CDiamCylFunc.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CDiamCylFuncError, 
+	    		"CDiamCylFunc.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CDiamCylFunc_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CDiamCylFunc_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CDiamCylFunc_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CDiamCylFunc *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CDiamCylFunc *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CDiamCylFuncError,
+	    	"CDiamCylFunc.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "length")) {
+        self->model->length.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CDiamCylFuncError,
+	    	"CDiamCylFunc.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CDiamCylFunc_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CDiamCylFuncType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CDiamCylFunc",             /*tp_name*/
+    sizeof(CDiamCylFunc),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CDiamCylFunc_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CDiamCylFunc objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CDiamCylFunc_methods,             /* tp_methods */
+    CDiamCylFunc_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CDiamCylFunc_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CDiamCylFunc_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCDiamCylFunc(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CDiamCylFuncType) < 0)
+        return;
+
+    Py_INCREF(&CDiamCylFuncType);
+    PyModule_AddObject(module, "CDiamCylFunc", (PyObject *)&CDiamCylFuncType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CDiamCylFunc.error";
+    CDiamCylFuncError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CDiamCylFuncError", CDiamCylFuncError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CDiamEllipFunc.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CDiamEllipFunc.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CDiamEllipFunc.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,579 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CDiamEllipFunc
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\DiamEllip.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "DiamEllip.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CDiamEllipFuncError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    DiamEllipFunc * model;
+    /// Log for unit testing
+    PyObject * log;
+} CDiamEllipFunc;
+
+
+static void
+CDiamEllipFunc_dealloc(CDiamEllipFunc* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CDiamEllipFunc_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CDiamEllipFunc *self;
+    
+    self = (CDiamEllipFunc *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CDiamEllipFunc_init(CDiamEllipFunc *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new DiamEllipFunc();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"radius_b",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"radius_a",Py_BuildValue("d",20.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius_a.dispersion->accept_as_source(visitor, self->model->radius_a.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius_a", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->radius_b.dispersion->accept_as_source(visitor, self->model->radius_b.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius_b", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CDiamEllipFunc_members[] = {
+    {name_params, T_OBJECT, offsetof(CDiamEllipFunc, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CDiamEllipFunc, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CDiamEllipFunc, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CDiamEllipFunc_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(DiamEllipFunc* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( DiamEllipFunc* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CDiamEllipFuncError, 
+                   "CDiamEllipFunc.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CDiamEllipFunc *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->radius_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_b") );
+    self->model->radius_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_a") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_a");
+    self->model->radius_a.dispersion->accept_as_destination(visitor, self->model->radius_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_b");
+    self->model->radius_b.dispersion->accept_as_destination(visitor, self->model->radius_b.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CDiamEllipFuncError, 
+	    	"CDiamEllipFunc.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CDiamEllipFuncError, 
+                   "CDiamEllipFunc.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CDiamEllipFuncError, 
+	    		"CDiamEllipFunc.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CDiamEllipFuncError, 
+                   "CDiamEllipFunc.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CDiamEllipFuncError, 
+                   "CDiamEllipFunc.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CDiamEllipFunc *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->radius_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_b") );
+    self->model->radius_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_a") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_a");
+    self->model->radius_a.dispersion->accept_as_destination(visitor, self->model->radius_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_b");
+    self->model->radius_b.dispersion->accept_as_destination(visitor, self->model->radius_b.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CDiamEllipFuncError, 
+	    	"CDiamEllipFunc.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CDiamEllipFuncError, 
+	    		"CDiamEllipFunc.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CDiamEllipFunc_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CDiamEllipFunc_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CDiamEllipFunc_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CDiamEllipFunc *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->radius_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_b") );
+    self->model->radius_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_a") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_a");
+    self->model->radius_a.dispersion->accept_as_destination(visitor, self->model->radius_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_b");
+    self->model->radius_b.dispersion->accept_as_destination(visitor, self->model->radius_b.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CDiamEllipFunc *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->radius_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_b") );
+    self->model->radius_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_a") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_a");
+    self->model->radius_a.dispersion->accept_as_destination(visitor, self->model->radius_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_b");
+    self->model->radius_b.dispersion->accept_as_destination(visitor, self->model->radius_b.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CDiamEllipFunc *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->radius_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_b") );
+    self->model->radius_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_a") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_a");
+    self->model->radius_a.dispersion->accept_as_destination(visitor, self->model->radius_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_b");
+    self->model->radius_b.dispersion->accept_as_destination(visitor, self->model->radius_b.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CDiamEllipFuncError, 
+	    	"CDiamEllipFunc.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CDiamEllipFuncError, 
+	    		"CDiamEllipFunc.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CDiamEllipFunc_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CDiamEllipFunc_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CDiamEllipFunc_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CDiamEllipFunc *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CDiamEllipFunc *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CDiamEllipFuncError,
+	    	"CDiamEllipFunc.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius_a")) {
+        self->model->radius_a.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "radius_b")) {
+        self->model->radius_b.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CDiamEllipFuncError,
+	    	"CDiamEllipFunc.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CDiamEllipFunc_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CDiamEllipFuncType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CDiamEllipFunc",             /*tp_name*/
+    sizeof(CDiamEllipFunc),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CDiamEllipFunc_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CDiamEllipFunc objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CDiamEllipFunc_methods,             /* tp_methods */
+    CDiamEllipFunc_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CDiamEllipFunc_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CDiamEllipFunc_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCDiamEllipFunc(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CDiamEllipFuncType) < 0)
+        return;
+
+    Py_INCREF(&CDiamEllipFuncType);
+    PyModule_AddObject(module, "CDiamEllipFunc", (PyObject *)&CDiamEllipFuncType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CDiamEllipFunc.error";
+    CDiamEllipFuncError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CDiamEllipFuncError", CDiamEllipFuncError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CEllipsoidModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CEllipsoidModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CEllipsoidModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,645 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CEllipsoidModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\ellipsoid.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "ellipsoid.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CEllipsoidModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    EllipsoidModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CEllipsoidModel;
+
+
+static void
+CEllipsoidModel_dealloc(CEllipsoidModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CEllipsoidModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CEllipsoidModel *self;
+    
+    self = (CEllipsoidModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CEllipsoidModel_init(CEllipsoidModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new EllipsoidModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",90.000000000000));
+        PyDict_SetItemString(self->params,"radius_b",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"radius_a",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldEll",Py_BuildValue("d",0.000004000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius_a.dispersion->accept_as_source(visitor, self->model->radius_a.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius_a", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->radius_b.dispersion->accept_as_source(visitor, self->model->radius_b.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius_b", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_theta.dispersion->accept_as_source(visitor, self->model->axis_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_theta", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_phi.dispersion->accept_as_source(visitor, self->model->axis_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_phi", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CEllipsoidModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CEllipsoidModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CEllipsoidModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CEllipsoidModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CEllipsoidModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(EllipsoidModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( EllipsoidModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CEllipsoidModelError, 
+                   "CEllipsoidModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CEllipsoidModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->radius_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_b") );
+    self->model->radius_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_a") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldEll = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldEll") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_a");
+    self->model->radius_a.dispersion->accept_as_destination(visitor, self->model->radius_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_b");
+    self->model->radius_b.dispersion->accept_as_destination(visitor, self->model->radius_b.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CEllipsoidModelError, 
+	    	"CEllipsoidModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CEllipsoidModelError, 
+                   "CEllipsoidModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CEllipsoidModelError, 
+	    		"CEllipsoidModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CEllipsoidModelError, 
+                   "CEllipsoidModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CEllipsoidModelError, 
+                   "CEllipsoidModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CEllipsoidModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->radius_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_b") );
+    self->model->radius_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_a") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldEll = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldEll") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_a");
+    self->model->radius_a.dispersion->accept_as_destination(visitor, self->model->radius_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_b");
+    self->model->radius_b.dispersion->accept_as_destination(visitor, self->model->radius_b.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CEllipsoidModelError, 
+	    	"CEllipsoidModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CEllipsoidModelError, 
+	    		"CEllipsoidModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CEllipsoidModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CEllipsoidModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CEllipsoidModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CEllipsoidModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->radius_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_b") );
+    self->model->radius_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_a") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldEll = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldEll") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_a");
+    self->model->radius_a.dispersion->accept_as_destination(visitor, self->model->radius_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_b");
+    self->model->radius_b.dispersion->accept_as_destination(visitor, self->model->radius_b.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CEllipsoidModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->radius_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_b") );
+    self->model->radius_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_a") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldEll = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldEll") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_a");
+    self->model->radius_a.dispersion->accept_as_destination(visitor, self->model->radius_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_b");
+    self->model->radius_b.dispersion->accept_as_destination(visitor, self->model->radius_b.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CEllipsoidModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->radius_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_b") );
+    self->model->radius_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_a") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldEll = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldEll") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_a");
+    self->model->radius_a.dispersion->accept_as_destination(visitor, self->model->radius_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_b");
+    self->model->radius_b.dispersion->accept_as_destination(visitor, self->model->radius_b.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CEllipsoidModelError, 
+	    	"CEllipsoidModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CEllipsoidModelError, 
+	    		"CEllipsoidModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CEllipsoidModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CEllipsoidModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CEllipsoidModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CEllipsoidModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CEllipsoidModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CEllipsoidModelError,
+	    	"CEllipsoidModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius_a")) {
+        self->model->radius_a.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "radius_b")) {
+        self->model->radius_b.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_theta")) {
+        self->model->axis_theta.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_phi")) {
+        self->model->axis_phi.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CEllipsoidModelError,
+	    	"CEllipsoidModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CEllipsoidModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CEllipsoidModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CEllipsoidModel",             /*tp_name*/
+    sizeof(CEllipsoidModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CEllipsoidModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CEllipsoidModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CEllipsoidModel_methods,             /* tp_methods */
+    CEllipsoidModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CEllipsoidModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CEllipsoidModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCEllipsoidModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CEllipsoidModelType) < 0)
+        return;
+
+    Py_INCREF(&CEllipsoidModelType);
+    PyModule_AddObject(module, "CEllipsoidModel", (PyObject *)&CEllipsoidModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CEllipsoidModel.error";
+    CEllipsoidModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CEllipsoidModelError", CEllipsoidModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CEllipticalCylinderModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CEllipticalCylinderModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CEllipticalCylinderModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,687 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CEllipticalCylinderModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\elliptical_cylinder.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "elliptical_cylinder.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CEllipticalCylinderModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    EllipticalCylinderModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CEllipticalCylinderModel;
+
+
+static void
+CEllipticalCylinderModel_dealloc(CEllipticalCylinderModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CEllipticalCylinderModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CEllipticalCylinderModel *self;
+    
+    self = (CEllipticalCylinderModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CEllipticalCylinderModel_init(CEllipticalCylinderModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new EllipticalCylinderModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sldCyl",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"cyl_psi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"r_minor",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"cyl_theta",Py_BuildValue("d",90.000000000000));
+        PyDict_SetItemString(self->params,"r_ratio",Py_BuildValue("d",1.500000000000));
+        PyDict_SetItemString(self->params,"cyl_phi",Py_BuildValue("d",0.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->r_minor.dispersion->accept_as_source(visitor, self->model->r_minor.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "r_minor", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->r_ratio.dispersion->accept_as_source(visitor, self->model->r_ratio.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "r_ratio", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "length", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->cyl_theta.dispersion->accept_as_source(visitor, self->model->cyl_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "cyl_theta", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->cyl_phi.dispersion->accept_as_source(visitor, self->model->cyl_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "cyl_phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->cyl_psi.dispersion->accept_as_source(visitor, self->model->cyl_psi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "cyl_psi", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CEllipticalCylinderModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CEllipticalCylinderModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CEllipticalCylinderModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CEllipticalCylinderModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CEllipticalCylinderModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(EllipticalCylinderModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( EllipticalCylinderModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CEllipticalCylinderModelError, 
+                   "CEllipticalCylinderModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CEllipticalCylinderModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->cyl_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_psi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->r_minor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "r_minor") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->cyl_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_theta") );
+    self->model->r_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "r_ratio") );
+    self->model->cyl_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_phi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "r_minor");
+    self->model->r_minor.dispersion->accept_as_destination(visitor, self->model->r_minor.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "r_ratio");
+    self->model->r_ratio.dispersion->accept_as_destination(visitor, self->model->r_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_theta");
+    self->model->cyl_theta.dispersion->accept_as_destination(visitor, self->model->cyl_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_phi");
+    self->model->cyl_phi.dispersion->accept_as_destination(visitor, self->model->cyl_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_psi");
+    self->model->cyl_psi.dispersion->accept_as_destination(visitor, self->model->cyl_psi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CEllipticalCylinderModelError, 
+	    	"CEllipticalCylinderModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CEllipticalCylinderModelError, 
+                   "CEllipticalCylinderModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CEllipticalCylinderModelError, 
+	    		"CEllipticalCylinderModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CEllipticalCylinderModelError, 
+                   "CEllipticalCylinderModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CEllipticalCylinderModelError, 
+                   "CEllipticalCylinderModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CEllipticalCylinderModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->cyl_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_psi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->r_minor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "r_minor") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->cyl_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_theta") );
+    self->model->r_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "r_ratio") );
+    self->model->cyl_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_phi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "r_minor");
+    self->model->r_minor.dispersion->accept_as_destination(visitor, self->model->r_minor.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "r_ratio");
+    self->model->r_ratio.dispersion->accept_as_destination(visitor, self->model->r_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_theta");
+    self->model->cyl_theta.dispersion->accept_as_destination(visitor, self->model->cyl_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_phi");
+    self->model->cyl_phi.dispersion->accept_as_destination(visitor, self->model->cyl_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_psi");
+    self->model->cyl_psi.dispersion->accept_as_destination(visitor, self->model->cyl_psi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CEllipticalCylinderModelError, 
+	    	"CEllipticalCylinderModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CEllipticalCylinderModelError, 
+	    		"CEllipticalCylinderModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CEllipticalCylinderModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CEllipticalCylinderModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CEllipticalCylinderModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CEllipticalCylinderModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->cyl_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_psi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->r_minor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "r_minor") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->cyl_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_theta") );
+    self->model->r_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "r_ratio") );
+    self->model->cyl_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_phi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "r_minor");
+    self->model->r_minor.dispersion->accept_as_destination(visitor, self->model->r_minor.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "r_ratio");
+    self->model->r_ratio.dispersion->accept_as_destination(visitor, self->model->r_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_theta");
+    self->model->cyl_theta.dispersion->accept_as_destination(visitor, self->model->cyl_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_phi");
+    self->model->cyl_phi.dispersion->accept_as_destination(visitor, self->model->cyl_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_psi");
+    self->model->cyl_psi.dispersion->accept_as_destination(visitor, self->model->cyl_psi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CEllipticalCylinderModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->cyl_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_psi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->r_minor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "r_minor") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->cyl_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_theta") );
+    self->model->r_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "r_ratio") );
+    self->model->cyl_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_phi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "r_minor");
+    self->model->r_minor.dispersion->accept_as_destination(visitor, self->model->r_minor.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "r_ratio");
+    self->model->r_ratio.dispersion->accept_as_destination(visitor, self->model->r_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_theta");
+    self->model->cyl_theta.dispersion->accept_as_destination(visitor, self->model->cyl_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_phi");
+    self->model->cyl_phi.dispersion->accept_as_destination(visitor, self->model->cyl_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_psi");
+    self->model->cyl_psi.dispersion->accept_as_destination(visitor, self->model->cyl_psi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CEllipticalCylinderModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->cyl_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_psi") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->r_minor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "r_minor") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->cyl_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_theta") );
+    self->model->r_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "r_ratio") );
+    self->model->cyl_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cyl_phi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "r_minor");
+    self->model->r_minor.dispersion->accept_as_destination(visitor, self->model->r_minor.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "r_ratio");
+    self->model->r_ratio.dispersion->accept_as_destination(visitor, self->model->r_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_theta");
+    self->model->cyl_theta.dispersion->accept_as_destination(visitor, self->model->cyl_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_phi");
+    self->model->cyl_phi.dispersion->accept_as_destination(visitor, self->model->cyl_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "cyl_psi");
+    self->model->cyl_psi.dispersion->accept_as_destination(visitor, self->model->cyl_psi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CEllipticalCylinderModelError, 
+	    	"CEllipticalCylinderModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CEllipticalCylinderModelError, 
+	    		"CEllipticalCylinderModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CEllipticalCylinderModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CEllipticalCylinderModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CEllipticalCylinderModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CEllipticalCylinderModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CEllipticalCylinderModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CEllipticalCylinderModelError,
+	    	"CEllipticalCylinderModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "r_minor")) {
+        self->model->r_minor.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "r_ratio")) {
+        self->model->r_ratio.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "length")) {
+        self->model->length.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "cyl_theta")) {
+        self->model->cyl_theta.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "cyl_phi")) {
+        self->model->cyl_phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "cyl_psi")) {
+        self->model->cyl_psi.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CEllipticalCylinderModelError,
+	    	"CEllipticalCylinderModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CEllipticalCylinderModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CEllipticalCylinderModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CEllipticalCylinderModel",             /*tp_name*/
+    sizeof(CEllipticalCylinderModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CEllipticalCylinderModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CEllipticalCylinderModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CEllipticalCylinderModel_methods,             /* tp_methods */
+    CEllipticalCylinderModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CEllipticalCylinderModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CEllipticalCylinderModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCEllipticalCylinderModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CEllipticalCylinderModelType) < 0)
+        return;
+
+    Py_INCREF(&CEllipticalCylinderModelType);
+    PyModule_AddObject(module, "CEllipticalCylinderModel", (PyObject *)&CEllipticalCylinderModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CEllipticalCylinderModel.error";
+    CEllipticalCylinderModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CEllipticalCylinderModelError", CEllipticalCylinderModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CFCCrystalModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CFCCrystalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CFCCrystalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,657 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CFCCrystalModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\fcc.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "fcc.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CFCCrystalModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    FCCrystalModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CFCCrystalModel;
+
+
+static void
+CFCCrystalModel_dealloc(CFCCrystalModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CFCCrystalModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CFCCrystalModel *self;
+    
+    self = (CFCCrystalModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CFCCrystalModel_init(CFCCrystalModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new FCCrystalModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"dnn",Py_BuildValue("d",220.000000000000));
+        PyDict_SetItemString(self->params,"sldSph",Py_BuildValue("d",0.000003000000));
+        PyDict_SetItemString(self->params,"d_factor",Py_BuildValue("d",0.060000000000));
+        PyDict_SetItemString(self->params,"psi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",40.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000006300000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->phi.dispersion->accept_as_source(visitor, self->model->phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->psi.dispersion->accept_as_source(visitor, self->model->psi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "psi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->theta.dispersion->accept_as_source(visitor, self->model->theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "theta", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CFCCrystalModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CFCCrystalModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CFCCrystalModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CFCCrystalModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CFCCrystalModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(FCCrystalModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( FCCrystalModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CFCCrystalModelError, 
+                   "CFCCrystalModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CFCCrystalModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFCCrystalModelError, 
+	    	"CFCCrystalModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CFCCrystalModelError, 
+                   "CFCCrystalModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CFCCrystalModelError, 
+	    		"CFCCrystalModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CFCCrystalModelError, 
+                   "CFCCrystalModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CFCCrystalModelError, 
+                   "CFCCrystalModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CFCCrystalModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFCCrystalModelError, 
+	    	"CFCCrystalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CFCCrystalModelError, 
+	    		"CFCCrystalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CFCCrystalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CFCCrystalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CFCCrystalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CFCCrystalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CFCCrystalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CFCCrystalModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFCCrystalModelError, 
+	    	"CFCCrystalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CFCCrystalModelError, 
+	    		"CFCCrystalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CFCCrystalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CFCCrystalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CFCCrystalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CFCCrystalModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CFCCrystalModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CFCCrystalModelError,
+	    	"CFCCrystalModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "phi")) {
+        self->model->phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "psi")) {
+        self->model->psi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "theta")) {
+        self->model->theta.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CFCCrystalModelError,
+	    	"CFCCrystalModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CFCCrystalModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CFCCrystalModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CFCCrystalModel",             /*tp_name*/
+    sizeof(CFCCrystalModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CFCCrystalModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CFCCrystalModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CFCCrystalModel_methods,             /* tp_methods */
+    CFCCrystalModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CFCCrystalModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CFCCrystalModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCFCCrystalModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CFCCrystalModelType) < 0)
+        return;
+
+    Py_INCREF(&CFCCrystalModelType);
+    PyModule_AddObject(module, "CFCCrystalModel", (PyObject *)&CFCCrystalModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CFCCrystalModel.error";
+    CFCCrystalModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CFCCrystalModelError", CFCCrystalModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CFlexCylEllipXModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CFlexCylEllipXModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CFlexCylEllipXModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,645 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CFlexCylEllipXModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\flexcyl_ellipX.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "flexcyl_ellipX.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CFlexCylEllipXModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    FlexCylEllipXModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CFlexCylEllipXModel;
+
+
+static void
+CFlexCylEllipXModel_dealloc(CFlexCylEllipXModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CFlexCylEllipXModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CFlexCylEllipXModel *self;
+    
+    self = (CFlexCylEllipXModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CFlexCylEllipXModel_init(CFlexCylEllipXModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new FlexCylEllipXModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sldCyl",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"axis_ratio",Py_BuildValue("d",1.500000000000));
+        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",1000.000000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000100000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000006300000));
+        PyDict_SetItemString(self->params,"kuhn_length",Py_BuildValue("d",100.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "length", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->kuhn_length.dispersion->accept_as_source(visitor, self->model->kuhn_length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "kuhn_length", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_ratio.dispersion->accept_as_source(visitor, self->model->axis_ratio.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_ratio", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CFlexCylEllipXModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CFlexCylEllipXModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CFlexCylEllipXModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CFlexCylEllipXModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CFlexCylEllipXModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(FlexCylEllipXModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( FlexCylEllipXModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CFlexCylEllipXModelError, 
+                   "CFlexCylEllipXModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CFlexCylEllipXModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->axis_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_ratio") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->kuhn_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "kuhn_length") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "kuhn_length");
+    self->model->kuhn_length.dispersion->accept_as_destination(visitor, self->model->kuhn_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_ratio");
+    self->model->axis_ratio.dispersion->accept_as_destination(visitor, self->model->axis_ratio.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFlexCylEllipXModelError, 
+	    	"CFlexCylEllipXModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CFlexCylEllipXModelError, 
+                   "CFlexCylEllipXModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CFlexCylEllipXModelError, 
+	    		"CFlexCylEllipXModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CFlexCylEllipXModelError, 
+                   "CFlexCylEllipXModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CFlexCylEllipXModelError, 
+                   "CFlexCylEllipXModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CFlexCylEllipXModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->axis_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_ratio") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->kuhn_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "kuhn_length") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "kuhn_length");
+    self->model->kuhn_length.dispersion->accept_as_destination(visitor, self->model->kuhn_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_ratio");
+    self->model->axis_ratio.dispersion->accept_as_destination(visitor, self->model->axis_ratio.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFlexCylEllipXModelError, 
+	    	"CFlexCylEllipXModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CFlexCylEllipXModelError, 
+	    		"CFlexCylEllipXModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CFlexCylEllipXModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CFlexCylEllipXModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CFlexCylEllipXModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CFlexCylEllipXModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->axis_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_ratio") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->kuhn_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "kuhn_length") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "kuhn_length");
+    self->model->kuhn_length.dispersion->accept_as_destination(visitor, self->model->kuhn_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_ratio");
+    self->model->axis_ratio.dispersion->accept_as_destination(visitor, self->model->axis_ratio.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CFlexCylEllipXModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->axis_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_ratio") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->kuhn_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "kuhn_length") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "kuhn_length");
+    self->model->kuhn_length.dispersion->accept_as_destination(visitor, self->model->kuhn_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_ratio");
+    self->model->axis_ratio.dispersion->accept_as_destination(visitor, self->model->axis_ratio.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CFlexCylEllipXModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->axis_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_ratio") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->kuhn_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "kuhn_length") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "kuhn_length");
+    self->model->kuhn_length.dispersion->accept_as_destination(visitor, self->model->kuhn_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_ratio");
+    self->model->axis_ratio.dispersion->accept_as_destination(visitor, self->model->axis_ratio.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFlexCylEllipXModelError, 
+	    	"CFlexCylEllipXModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CFlexCylEllipXModelError, 
+	    		"CFlexCylEllipXModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CFlexCylEllipXModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CFlexCylEllipXModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CFlexCylEllipXModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CFlexCylEllipXModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CFlexCylEllipXModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CFlexCylEllipXModelError,
+	    	"CFlexCylEllipXModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "length")) {
+        self->model->length.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "kuhn_length")) {
+        self->model->kuhn_length.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_ratio")) {
+        self->model->axis_ratio.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CFlexCylEllipXModelError,
+	    	"CFlexCylEllipXModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CFlexCylEllipXModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CFlexCylEllipXModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CFlexCylEllipXModel",             /*tp_name*/
+    sizeof(CFlexCylEllipXModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CFlexCylEllipXModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CFlexCylEllipXModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CFlexCylEllipXModel_methods,             /* tp_methods */
+    CFlexCylEllipXModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CFlexCylEllipXModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CFlexCylEllipXModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCFlexCylEllipXModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CFlexCylEllipXModelType) < 0)
+        return;
+
+    Py_INCREF(&CFlexCylEllipXModelType);
+    PyModule_AddObject(module, "CFlexCylEllipXModel", (PyObject *)&CFlexCylEllipXModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CFlexCylEllipXModel.error";
+    CFlexCylEllipXModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CFlexCylEllipXModelError", CFlexCylEllipXModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CFlexibleCylinderModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CFlexibleCylinderModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CFlexibleCylinderModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,624 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CFlexibleCylinderModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\flexible_cylinder.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "flexible_cylinder.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CFlexibleCylinderModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    FlexibleCylinderModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CFlexibleCylinderModel;
+
+
+static void
+CFlexibleCylinderModel_dealloc(CFlexibleCylinderModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CFlexibleCylinderModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CFlexibleCylinderModel *self;
+    
+    self = (CFlexibleCylinderModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CFlexibleCylinderModel_init(CFlexibleCylinderModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new FlexibleCylinderModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sldCyl",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",1000.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000006300000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000100000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"kuhn_length",Py_BuildValue("d",100.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "length", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->kuhn_length.dispersion->accept_as_source(visitor, self->model->kuhn_length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "kuhn_length", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CFlexibleCylinderModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CFlexibleCylinderModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CFlexibleCylinderModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CFlexibleCylinderModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CFlexibleCylinderModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(FlexibleCylinderModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( FlexibleCylinderModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CFlexibleCylinderModelError, 
+                   "CFlexibleCylinderModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CFlexibleCylinderModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->kuhn_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "kuhn_length") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "kuhn_length");
+    self->model->kuhn_length.dispersion->accept_as_destination(visitor, self->model->kuhn_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFlexibleCylinderModelError, 
+	    	"CFlexibleCylinderModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CFlexibleCylinderModelError, 
+                   "CFlexibleCylinderModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CFlexibleCylinderModelError, 
+	    		"CFlexibleCylinderModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CFlexibleCylinderModelError, 
+                   "CFlexibleCylinderModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CFlexibleCylinderModelError, 
+                   "CFlexibleCylinderModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CFlexibleCylinderModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->kuhn_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "kuhn_length") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "kuhn_length");
+    self->model->kuhn_length.dispersion->accept_as_destination(visitor, self->model->kuhn_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFlexibleCylinderModelError, 
+	    	"CFlexibleCylinderModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CFlexibleCylinderModelError, 
+	    		"CFlexibleCylinderModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CFlexibleCylinderModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CFlexibleCylinderModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CFlexibleCylinderModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CFlexibleCylinderModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->kuhn_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "kuhn_length") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "kuhn_length");
+    self->model->kuhn_length.dispersion->accept_as_destination(visitor, self->model->kuhn_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CFlexibleCylinderModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->kuhn_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "kuhn_length") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "kuhn_length");
+    self->model->kuhn_length.dispersion->accept_as_destination(visitor, self->model->kuhn_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CFlexibleCylinderModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->kuhn_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "kuhn_length") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "kuhn_length");
+    self->model->kuhn_length.dispersion->accept_as_destination(visitor, self->model->kuhn_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFlexibleCylinderModelError, 
+	    	"CFlexibleCylinderModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CFlexibleCylinderModelError, 
+	    		"CFlexibleCylinderModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CFlexibleCylinderModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CFlexibleCylinderModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CFlexibleCylinderModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CFlexibleCylinderModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CFlexibleCylinderModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CFlexibleCylinderModelError,
+	    	"CFlexibleCylinderModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "length")) {
+        self->model->length.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "kuhn_length")) {
+        self->model->kuhn_length.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CFlexibleCylinderModelError,
+	    	"CFlexibleCylinderModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CFlexibleCylinderModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CFlexibleCylinderModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CFlexibleCylinderModel",             /*tp_name*/
+    sizeof(CFlexibleCylinderModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CFlexibleCylinderModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CFlexibleCylinderModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CFlexibleCylinderModel_methods,             /* tp_methods */
+    CFlexibleCylinderModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CFlexibleCylinderModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CFlexibleCylinderModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCFlexibleCylinderModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CFlexibleCylinderModelType) < 0)
+        return;
+
+    Py_INCREF(&CFlexibleCylinderModelType);
+    PyModule_AddObject(module, "CFlexibleCylinderModel", (PyObject *)&CFlexibleCylinderModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CFlexibleCylinderModel.error";
+    CFlexibleCylinderModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CFlexibleCylinderModelError", CFlexibleCylinderModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CFractalModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CFractalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CFractalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,594 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CFractalModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\fractal.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "fractal.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CFractalModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    FractalModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CFractalModel;
+
+
+static void
+CFractalModel_dealloc(CFractalModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CFractalModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CFractalModel *self;
+    
+    self = (CFractalModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CFractalModel_init(CFractalModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new FractalModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",0.050000000000));
+        PyDict_SetItemString(self->params,"fractal_dim",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000006350000));
+        PyDict_SetItemString(self->params,"cor_length",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",5.000000000000));
+        PyDict_SetItemString(self->params,"sldBlock",Py_BuildValue("d",0.000002000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CFractalModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CFractalModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CFractalModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CFractalModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CFractalModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(FractalModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( FractalModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CFractalModelError, 
+                   "CFractalModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CFractalModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->fractal_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fractal_dim") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->cor_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cor_length") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->sldBlock = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldBlock") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFractalModelError, 
+	    	"CFractalModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CFractalModelError, 
+                   "CFractalModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CFractalModelError, 
+	    		"CFractalModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CFractalModelError, 
+                   "CFractalModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CFractalModelError, 
+                   "CFractalModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CFractalModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->fractal_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fractal_dim") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->cor_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cor_length") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->sldBlock = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldBlock") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFractalModelError, 
+	    	"CFractalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CFractalModelError, 
+	    		"CFractalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CFractalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CFractalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CFractalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CFractalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->fractal_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fractal_dim") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->cor_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cor_length") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->sldBlock = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldBlock") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CFractalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->fractal_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fractal_dim") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->cor_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cor_length") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->sldBlock = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldBlock") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CFractalModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->fractal_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fractal_dim") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->cor_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cor_length") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->sldBlock = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldBlock") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFractalModelError, 
+	    	"CFractalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CFractalModelError, 
+	    		"CFractalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CFractalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CFractalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CFractalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CFractalModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CFractalModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CFractalModelError,
+	    	"CFractalModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CFractalModelError,
+	    	"CFractalModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CFractalModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CFractalModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CFractalModel",             /*tp_name*/
+    sizeof(CFractalModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CFractalModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CFractalModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CFractalModel_methods,             /* tp_methods */
+    CFractalModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CFractalModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CFractalModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCFractalModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CFractalModelType) < 0)
+        return;
+
+    Py_INCREF(&CFractalModelType);
+    PyModule_AddObject(module, "CFractalModel", (PyObject *)&CFractalModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CFractalModel.error";
+    CFractalModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CFractalModelError", CFractalModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CFractalO_Z.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CFractalO_Z.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CFractalO_Z.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,555 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CFractalO_Z
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\FractalQtoN.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "FractalQtoN.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CFractalO_ZError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    FractalO_Z * model;
+    /// Log for unit testing
+    PyObject * log;
+} CFractalO_Z;
+
+
+static void
+CFractalO_Z_dealloc(CFractalO_Z* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CFractalO_Z_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CFractalO_Z *self;
+    
+    self = (CFractalO_Z *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CFractalO_Z_init(CFractalO_Z *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new FractalO_Z();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"s_fractal",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"cluster_rg",Py_BuildValue("d",3520.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",10000.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.010000000000));
+        PyDict_SetItemString(self->params,"m_fractal",Py_BuildValue("d",1.800000000000));
+        PyDict_SetItemString(self->params,"primary_rg",Py_BuildValue("d",82.000000000000));
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CFractalO_Z_members[] = {
+    {name_params, T_OBJECT, offsetof(CFractalO_Z, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CFractalO_Z, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CFractalO_Z, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CFractalO_Z_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(FractalO_Z* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( FractalO_Z* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CFractalO_ZError, 
+                   "CFractalO_Z.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CFractalO_Z *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->s_fractal = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_fractal") );
+    self->model->cluster_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cluster_rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->m_fractal = PyFloat_AsDouble( PyDict_GetItemString(self->params, "m_fractal") );
+    self->model->primary_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "primary_rg") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFractalO_ZError, 
+	    	"CFractalO_Z.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CFractalO_ZError, 
+                   "CFractalO_Z.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CFractalO_ZError, 
+	    		"CFractalO_Z.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CFractalO_ZError, 
+                   "CFractalO_Z.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CFractalO_ZError, 
+                   "CFractalO_Z.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CFractalO_Z *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->s_fractal = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_fractal") );
+    self->model->cluster_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cluster_rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->m_fractal = PyFloat_AsDouble( PyDict_GetItemString(self->params, "m_fractal") );
+    self->model->primary_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "primary_rg") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFractalO_ZError, 
+	    	"CFractalO_Z.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CFractalO_ZError, 
+	    		"CFractalO_Z.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CFractalO_Z_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CFractalO_Z_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CFractalO_Z_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CFractalO_Z *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->s_fractal = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_fractal") );
+    self->model->cluster_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cluster_rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->m_fractal = PyFloat_AsDouble( PyDict_GetItemString(self->params, "m_fractal") );
+    self->model->primary_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "primary_rg") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CFractalO_Z *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->s_fractal = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_fractal") );
+    self->model->cluster_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cluster_rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->m_fractal = PyFloat_AsDouble( PyDict_GetItemString(self->params, "m_fractal") );
+    self->model->primary_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "primary_rg") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CFractalO_Z *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->s_fractal = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_fractal") );
+    self->model->cluster_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cluster_rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->m_fractal = PyFloat_AsDouble( PyDict_GetItemString(self->params, "m_fractal") );
+    self->model->primary_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "primary_rg") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFractalO_ZError, 
+	    	"CFractalO_Z.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CFractalO_ZError, 
+	    		"CFractalO_Z.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CFractalO_Z_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CFractalO_Z_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CFractalO_Z_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CFractalO_Z *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CFractalO_Z *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CFractalO_ZError,
+	    	"CFractalO_Z.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+ {
+	    PyErr_SetString(CFractalO_ZError,
+	    	"CFractalO_Z.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CFractalO_Z_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CFractalO_ZType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CFractalO_Z",             /*tp_name*/
+    sizeof(CFractalO_Z),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CFractalO_Z_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CFractalO_Z objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CFractalO_Z_methods,             /* tp_methods */
+    CFractalO_Z_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CFractalO_Z_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CFractalO_Z_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCFractalO_Z(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CFractalO_ZType) < 0)
+        return;
+
+    Py_INCREF(&CFractalO_ZType);
+    PyModule_AddObject(module, "CFractalO_Z", (PyObject *)&CFractalO_ZType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CFractalO_Z.error";
+    CFractalO_ZError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CFractalO_ZError", CFractalO_ZError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CFuzzySphereModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CFuzzySphereModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CFuzzySphereModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,603 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CFuzzySphereModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\fuzzysphere.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "fuzzysphere.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CFuzzySphereModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    FuzzySphereModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CFuzzySphereModel;
+
+
+static void
+CFuzzySphereModel_dealloc(CFuzzySphereModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CFuzzySphereModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CFuzzySphereModel *self;
+    
+    self = (CFuzzySphereModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CFuzzySphereModel_init(CFuzzySphereModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new FuzzySphereModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",0.010000000000));
+        PyDict_SetItemString(self->params,"sldSph",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",60.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000003000000));
+        PyDict_SetItemString(self->params,"fuzziness",Py_BuildValue("d",10.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->fuzziness.dispersion->accept_as_source(visitor, self->model->fuzziness.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "fuzziness", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CFuzzySphereModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CFuzzySphereModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CFuzzySphereModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CFuzzySphereModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CFuzzySphereModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(FuzzySphereModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( FuzzySphereModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CFuzzySphereModelError, 
+                   "CFuzzySphereModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CFuzzySphereModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->fuzziness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fuzziness") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "fuzziness");
+    self->model->fuzziness.dispersion->accept_as_destination(visitor, self->model->fuzziness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFuzzySphereModelError, 
+	    	"CFuzzySphereModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CFuzzySphereModelError, 
+                   "CFuzzySphereModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CFuzzySphereModelError, 
+	    		"CFuzzySphereModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CFuzzySphereModelError, 
+                   "CFuzzySphereModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CFuzzySphereModelError, 
+                   "CFuzzySphereModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CFuzzySphereModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->fuzziness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fuzziness") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "fuzziness");
+    self->model->fuzziness.dispersion->accept_as_destination(visitor, self->model->fuzziness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFuzzySphereModelError, 
+	    	"CFuzzySphereModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CFuzzySphereModelError, 
+	    		"CFuzzySphereModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CFuzzySphereModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CFuzzySphereModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CFuzzySphereModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CFuzzySphereModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->fuzziness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fuzziness") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "fuzziness");
+    self->model->fuzziness.dispersion->accept_as_destination(visitor, self->model->fuzziness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CFuzzySphereModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->fuzziness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fuzziness") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "fuzziness");
+    self->model->fuzziness.dispersion->accept_as_destination(visitor, self->model->fuzziness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CFuzzySphereModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->fuzziness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fuzziness") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "fuzziness");
+    self->model->fuzziness.dispersion->accept_as_destination(visitor, self->model->fuzziness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CFuzzySphereModelError, 
+	    	"CFuzzySphereModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CFuzzySphereModelError, 
+	    		"CFuzzySphereModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CFuzzySphereModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CFuzzySphereModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CFuzzySphereModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CFuzzySphereModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CFuzzySphereModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CFuzzySphereModelError,
+	    	"CFuzzySphereModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "fuzziness")) {
+        self->model->fuzziness.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CFuzzySphereModelError,
+	    	"CFuzzySphereModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CFuzzySphereModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CFuzzySphereModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CFuzzySphereModel",             /*tp_name*/
+    sizeof(CFuzzySphereModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CFuzzySphereModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CFuzzySphereModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CFuzzySphereModel_methods,             /* tp_methods */
+    CFuzzySphereModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CFuzzySphereModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CFuzzySphereModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCFuzzySphereModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CFuzzySphereModelType) < 0)
+        return;
+
+    Py_INCREF(&CFuzzySphereModelType);
+    PyModule_AddObject(module, "CFuzzySphereModel", (PyObject *)&CFuzzySphereModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CFuzzySphereModel.error";
+    CFuzzySphereModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CFuzzySphereModelError", CFuzzySphereModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CGaussian.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CGaussian.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CGaussian.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,537 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CGaussian
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\gaussian.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "gaussian.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CGaussianError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    Gaussian * model;
+    /// Log for unit testing
+    PyObject * log;
+} CGaussian;
+
+
+static void
+CGaussian_dealloc(CGaussian* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CGaussian_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CGaussian *self;
+    
+    self = (CGaussian *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CGaussian_init(CGaussian *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new Gaussian();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sigma",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"center",Py_BuildValue("d",0.000000000000));
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CGaussian_members[] = {
+    {name_params, T_OBJECT, offsetof(CGaussian, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CGaussian, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CGaussian, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CGaussian_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(Gaussian* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( Gaussian* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CGaussianError, 
+                   "CGaussian.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CGaussian *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CGaussianError, 
+	    	"CGaussian.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CGaussianError, 
+                   "CGaussian.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CGaussianError, 
+	    		"CGaussian.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CGaussianError, 
+                   "CGaussian.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CGaussianError, 
+                   "CGaussian.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CGaussian *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CGaussianError, 
+	    	"CGaussian.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CGaussianError, 
+	    		"CGaussian.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CGaussian_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CGaussian_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CGaussian_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CGaussian *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CGaussian *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CGaussian *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CGaussianError, 
+	    	"CGaussian.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CGaussianError, 
+	    		"CGaussian.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CGaussian_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CGaussian_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CGaussian_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CGaussian *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CGaussian *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CGaussianError,
+	    	"CGaussian.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+ {
+	    PyErr_SetString(CGaussianError,
+	    	"CGaussian.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CGaussian_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CGaussianType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CGaussian",             /*tp_name*/
+    sizeof(CGaussian),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CGaussian_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CGaussian objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CGaussian_methods,             /* tp_methods */
+    CGaussian_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CGaussian_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CGaussian_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCGaussian(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CGaussianType) < 0)
+        return;
+
+    Py_INCREF(&CGaussianType);
+    PyModule_AddObject(module, "CGaussian", (PyObject *)&CGaussianType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CGaussian.error";
+    CGaussianError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CGaussianError", CGaussianError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CGelFitModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CGelFitModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CGelFitModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,555 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CGelFitModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\GelFit.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "GelFit.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CGelFitModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    GelFitModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CGelFitModel;
+
+
+static void
+CGelFitModel_dealloc(CGelFitModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CGelFitModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CGelFitModel *self;
+    
+    self = (CGelFitModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CGelFitModel_init(CGelFitModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new GelFitModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"gScale",Py_BuildValue("d",1.700000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",104.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.010000000000));
+        PyDict_SetItemString(self->params,"zeta",Py_BuildValue("d",16.000000000000));
+        PyDict_SetItemString(self->params,"lScale",Py_BuildValue("d",3.500000000000));
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CGelFitModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CGelFitModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CGelFitModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CGelFitModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CGelFitModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(GelFitModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( GelFitModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CGelFitModelError, 
+                   "CGelFitModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CGelFitModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->gScale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "gScale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->zeta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "zeta") );
+    self->model->lScale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "lScale") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CGelFitModelError, 
+	    	"CGelFitModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CGelFitModelError, 
+                   "CGelFitModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CGelFitModelError, 
+	    		"CGelFitModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CGelFitModelError, 
+                   "CGelFitModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CGelFitModelError, 
+                   "CGelFitModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CGelFitModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->gScale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "gScale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->zeta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "zeta") );
+    self->model->lScale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "lScale") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CGelFitModelError, 
+	    	"CGelFitModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CGelFitModelError, 
+	    		"CGelFitModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CGelFitModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CGelFitModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CGelFitModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CGelFitModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->gScale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "gScale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->zeta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "zeta") );
+    self->model->lScale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "lScale") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CGelFitModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->gScale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "gScale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->zeta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "zeta") );
+    self->model->lScale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "lScale") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CGelFitModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->gScale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "gScale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->zeta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "zeta") );
+    self->model->lScale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "lScale") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CGelFitModelError, 
+	    	"CGelFitModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CGelFitModelError, 
+	    		"CGelFitModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CGelFitModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CGelFitModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CGelFitModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CGelFitModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CGelFitModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CGelFitModelError,
+	    	"CGelFitModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+ {
+	    PyErr_SetString(CGelFitModelError,
+	    	"CGelFitModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CGelFitModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CGelFitModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CGelFitModel",             /*tp_name*/
+    sizeof(CGelFitModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CGelFitModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CGelFitModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CGelFitModel_methods,             /* tp_methods */
+    CGelFitModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CGelFitModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CGelFitModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCGelFitModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CGelFitModelType) < 0)
+        return;
+
+    Py_INCREF(&CGelFitModelType);
+    PyModule_AddObject(module, "CGelFitModel", (PyObject *)&CGelFitModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CGelFitModel.error";
+    CGelFitModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CGelFitModelError", CGelFitModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CHardsphereStructure.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CHardsphereStructure.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CHardsphereStructure.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,564 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CHardsphereStructure
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\Hardsphere.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "Hardsphere.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CHardsphereStructureError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    HardsphereStructure * model;
+    /// Log for unit testing
+    PyObject * log;
+} CHardsphereStructure;
+
+
+static void
+CHardsphereStructure_dealloc(CHardsphereStructure* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CHardsphereStructure_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CHardsphereStructure *self;
+    
+    self = (CHardsphereStructure *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CHardsphereStructure_init(CHardsphereStructure *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new HardsphereStructure();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"effect_radius",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"volfraction",Py_BuildValue("d",0.200000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->effect_radius.dispersion->accept_as_source(visitor, self->model->effect_radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "effect_radius", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CHardsphereStructure_members[] = {
+    {name_params, T_OBJECT, offsetof(CHardsphereStructure, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CHardsphereStructure, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CHardsphereStructure, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CHardsphereStructure_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(HardsphereStructure* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( HardsphereStructure* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CHardsphereStructureError, 
+                   "CHardsphereStructure.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CHardsphereStructure *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CHardsphereStructureError, 
+	    	"CHardsphereStructure.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CHardsphereStructureError, 
+                   "CHardsphereStructure.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CHardsphereStructureError, 
+	    		"CHardsphereStructure.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CHardsphereStructureError, 
+                   "CHardsphereStructure.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CHardsphereStructureError, 
+                   "CHardsphereStructure.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CHardsphereStructure *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CHardsphereStructureError, 
+	    	"CHardsphereStructure.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CHardsphereStructureError, 
+	    		"CHardsphereStructure.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CHardsphereStructure_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CHardsphereStructure_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CHardsphereStructure_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CHardsphereStructure *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CHardsphereStructure *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CHardsphereStructure *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CHardsphereStructureError, 
+	    	"CHardsphereStructure.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CHardsphereStructureError, 
+	    		"CHardsphereStructure.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CHardsphereStructure_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CHardsphereStructure_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CHardsphereStructure_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CHardsphereStructure *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CHardsphereStructure *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CHardsphereStructureError,
+	    	"CHardsphereStructure.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "effect_radius")) {
+        self->model->effect_radius.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CHardsphereStructureError,
+	    	"CHardsphereStructure.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CHardsphereStructure_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CHardsphereStructureType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CHardsphereStructure",             /*tp_name*/
+    sizeof(CHardsphereStructure),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CHardsphereStructure_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CHardsphereStructure objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CHardsphereStructure_methods,             /* tp_methods */
+    CHardsphereStructure_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CHardsphereStructure_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CHardsphereStructure_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCHardsphereStructure(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CHardsphereStructureType) < 0)
+        return;
+
+    Py_INCREF(&CHardsphereStructureType);
+    PyModule_AddObject(module, "CHardsphereStructure", (PyObject *)&CHardsphereStructureType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CHardsphereStructure.error";
+    CHardsphereStructureError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CHardsphereStructureError", CHardsphereStructureError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CHayterMSAStructure.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CHayterMSAStructure.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CHayterMSAStructure.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,588 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CHayterMSAStructure
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\HayterMSA.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "HayterMSA.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CHayterMSAStructureError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    HayterMSAStructure * model;
+    /// Log for unit testing
+    PyObject * log;
+} CHayterMSAStructure;
+
+
+static void
+CHayterMSAStructure_dealloc(CHayterMSAStructure* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CHayterMSAStructure_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CHayterMSAStructure *self;
+    
+    self = (CHayterMSAStructure *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CHayterMSAStructure_init(CHayterMSAStructure *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new HayterMSAStructure();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"temperature",Py_BuildValue("d",318.160000000000));
+        PyDict_SetItemString(self->params,"saltconc",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"dielectconst",Py_BuildValue("d",71.080000000000));
+        PyDict_SetItemString(self->params,"volfraction",Py_BuildValue("d",0.019200000000));
+        PyDict_SetItemString(self->params,"charge",Py_BuildValue("d",19.000000000000));
+        PyDict_SetItemString(self->params,"effect_radius",Py_BuildValue("d",20.750000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->effect_radius.dispersion->accept_as_source(visitor, self->model->effect_radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "effect_radius", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CHayterMSAStructure_members[] = {
+    {name_params, T_OBJECT, offsetof(CHayterMSAStructure, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CHayterMSAStructure, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CHayterMSAStructure, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CHayterMSAStructure_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(HayterMSAStructure* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( HayterMSAStructure* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CHayterMSAStructureError, 
+                   "CHayterMSAStructure.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CHayterMSAStructure *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->temperature = PyFloat_AsDouble( PyDict_GetItemString(self->params, "temperature") );
+    self->model->saltconc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "saltconc") );
+    self->model->dielectconst = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dielectconst") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->charge = PyFloat_AsDouble( PyDict_GetItemString(self->params, "charge") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CHayterMSAStructureError, 
+	    	"CHayterMSAStructure.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CHayterMSAStructureError, 
+                   "CHayterMSAStructure.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CHayterMSAStructureError, 
+	    		"CHayterMSAStructure.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CHayterMSAStructureError, 
+                   "CHayterMSAStructure.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CHayterMSAStructureError, 
+                   "CHayterMSAStructure.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CHayterMSAStructure *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->temperature = PyFloat_AsDouble( PyDict_GetItemString(self->params, "temperature") );
+    self->model->saltconc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "saltconc") );
+    self->model->dielectconst = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dielectconst") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->charge = PyFloat_AsDouble( PyDict_GetItemString(self->params, "charge") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CHayterMSAStructureError, 
+	    	"CHayterMSAStructure.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CHayterMSAStructureError, 
+	    		"CHayterMSAStructure.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CHayterMSAStructure_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CHayterMSAStructure_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CHayterMSAStructure_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CHayterMSAStructure *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->temperature = PyFloat_AsDouble( PyDict_GetItemString(self->params, "temperature") );
+    self->model->saltconc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "saltconc") );
+    self->model->dielectconst = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dielectconst") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->charge = PyFloat_AsDouble( PyDict_GetItemString(self->params, "charge") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CHayterMSAStructure *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->temperature = PyFloat_AsDouble( PyDict_GetItemString(self->params, "temperature") );
+    self->model->saltconc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "saltconc") );
+    self->model->dielectconst = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dielectconst") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->charge = PyFloat_AsDouble( PyDict_GetItemString(self->params, "charge") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CHayterMSAStructure *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->temperature = PyFloat_AsDouble( PyDict_GetItemString(self->params, "temperature") );
+    self->model->saltconc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "saltconc") );
+    self->model->dielectconst = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dielectconst") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->charge = PyFloat_AsDouble( PyDict_GetItemString(self->params, "charge") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CHayterMSAStructureError, 
+	    	"CHayterMSAStructure.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CHayterMSAStructureError, 
+	    		"CHayterMSAStructure.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CHayterMSAStructure_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CHayterMSAStructure_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CHayterMSAStructure_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CHayterMSAStructure *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CHayterMSAStructure *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CHayterMSAStructureError,
+	    	"CHayterMSAStructure.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "effect_radius")) {
+        self->model->effect_radius.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CHayterMSAStructureError,
+	    	"CHayterMSAStructure.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CHayterMSAStructure_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CHayterMSAStructureType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CHayterMSAStructure",             /*tp_name*/
+    sizeof(CHayterMSAStructure),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CHayterMSAStructure_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CHayterMSAStructure objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CHayterMSAStructure_methods,             /* tp_methods */
+    CHayterMSAStructure_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CHayterMSAStructure_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CHayterMSAStructure_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCHayterMSAStructure(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CHayterMSAStructureType) < 0)
+        return;
+
+    Py_INCREF(&CHayterMSAStructureType);
+    PyModule_AddObject(module, "CHayterMSAStructure", (PyObject *)&CHayterMSAStructureType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CHayterMSAStructure.error";
+    CHayterMSAStructureError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CHayterMSAStructureError", CHayterMSAStructureError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CHollowCylinderModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CHollowCylinderModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CHollowCylinderModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,666 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CHollowCylinderModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\hollow_cylinder.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "hollow_cylinder.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CHollowCylinderModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    HollowCylinderModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CHollowCylinderModel;
+
+
+static void
+CHollowCylinderModel_dealloc(CHollowCylinderModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CHollowCylinderModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CHollowCylinderModel *self;
+    
+    self = (CHollowCylinderModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CHollowCylinderModel_init(CHollowCylinderModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new HollowCylinderModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sldCyl",Py_BuildValue("d",0.000006300000));
+        PyDict_SetItemString(self->params,"core_radius",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",90.000000000000));
+        PyDict_SetItemString(self->params,"length",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.010000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",30.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->core_radius.dispersion->accept_as_source(visitor, self->model->core_radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "core_radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "length", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_theta.dispersion->accept_as_source(visitor, self->model->axis_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_theta", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_phi.dispersion->accept_as_source(visitor, self->model->axis_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_phi", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CHollowCylinderModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CHollowCylinderModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CHollowCylinderModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CHollowCylinderModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CHollowCylinderModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(HollowCylinderModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( HollowCylinderModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CHollowCylinderModelError, 
+                   "CHollowCylinderModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CHollowCylinderModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius");
+    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CHollowCylinderModelError, 
+	    	"CHollowCylinderModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CHollowCylinderModelError, 
+                   "CHollowCylinderModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CHollowCylinderModelError, 
+	    		"CHollowCylinderModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CHollowCylinderModelError, 
+                   "CHollowCylinderModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CHollowCylinderModelError, 
+                   "CHollowCylinderModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CHollowCylinderModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius");
+    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CHollowCylinderModelError, 
+	    	"CHollowCylinderModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CHollowCylinderModelError, 
+	    		"CHollowCylinderModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CHollowCylinderModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CHollowCylinderModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CHollowCylinderModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CHollowCylinderModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius");
+    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CHollowCylinderModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius");
+    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CHollowCylinderModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldCyl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldCyl") );
+    self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius");
+    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "length");
+    self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CHollowCylinderModelError, 
+	    	"CHollowCylinderModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CHollowCylinderModelError, 
+	    		"CHollowCylinderModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CHollowCylinderModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CHollowCylinderModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CHollowCylinderModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CHollowCylinderModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CHollowCylinderModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CHollowCylinderModelError,
+	    	"CHollowCylinderModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "core_radius")) {
+        self->model->core_radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "length")) {
+        self->model->length.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_theta")) {
+        self->model->axis_theta.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_phi")) {
+        self->model->axis_phi.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CHollowCylinderModelError,
+	    	"CHollowCylinderModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CHollowCylinderModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CHollowCylinderModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CHollowCylinderModel",             /*tp_name*/
+    sizeof(CHollowCylinderModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CHollowCylinderModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CHollowCylinderModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CHollowCylinderModel_methods,             /* tp_methods */
+    CHollowCylinderModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CHollowCylinderModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CHollowCylinderModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCHollowCylinderModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CHollowCylinderModelType) < 0)
+        return;
+
+    Py_INCREF(&CHollowCylinderModelType);
+    PyModule_AddObject(module, "CHollowCylinderModel", (PyObject *)&CHollowCylinderModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CHollowCylinderModel.error";
+    CHollowCylinderModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CHollowCylinderModelError", CHollowCylinderModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CLamellarFFHGModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CLamellarFFHGModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CLamellarFFHGModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,609 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CLamellarFFHGModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\lamellarFF_HG.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "lamellarFF_HG.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CLamellarFFHGModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    LamellarFFHGModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CLamellarFFHGModel;
+
+
+static void
+CLamellarFFHGModel_dealloc(CLamellarFFHGModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CLamellarFFHGModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CLamellarFFHGModel *self;
+    
+    self = (CLamellarFFHGModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CLamellarFFHGModel_init(CLamellarFFHGModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new LamellarFFHGModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"h_thickness",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"sld_tail",Py_BuildValue("d",0.000000400000));
+        PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006000000));
+        PyDict_SetItemString(self->params,"t_length",Py_BuildValue("d",15.000000000000));
+        PyDict_SetItemString(self->params,"sld_head",Py_BuildValue("d",0.000003000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->t_length.dispersion->accept_as_source(visitor, self->model->t_length.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "t_length", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->h_thickness.dispersion->accept_as_source(visitor, self->model->h_thickness.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "h_thickness", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CLamellarFFHGModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CLamellarFFHGModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CLamellarFFHGModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CLamellarFFHGModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CLamellarFFHGModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(LamellarFFHGModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( LamellarFFHGModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CLamellarFFHGModelError, 
+                   "CLamellarFFHGModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CLamellarFFHGModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->h_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "h_thickness") );
+    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->t_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "t_length") );
+    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "t_length");
+    self->model->t_length.dispersion->accept_as_destination(visitor, self->model->t_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "h_thickness");
+    self->model->h_thickness.dispersion->accept_as_destination(visitor, self->model->h_thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarFFHGModelError, 
+	    	"CLamellarFFHGModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CLamellarFFHGModelError, 
+                   "CLamellarFFHGModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CLamellarFFHGModelError, 
+	    		"CLamellarFFHGModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CLamellarFFHGModelError, 
+                   "CLamellarFFHGModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CLamellarFFHGModelError, 
+                   "CLamellarFFHGModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CLamellarFFHGModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->h_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "h_thickness") );
+    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->t_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "t_length") );
+    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "t_length");
+    self->model->t_length.dispersion->accept_as_destination(visitor, self->model->t_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "h_thickness");
+    self->model->h_thickness.dispersion->accept_as_destination(visitor, self->model->h_thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarFFHGModelError, 
+	    	"CLamellarFFHGModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLamellarFFHGModelError, 
+	    		"CLamellarFFHGModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CLamellarFFHGModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CLamellarFFHGModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CLamellarFFHGModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CLamellarFFHGModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->h_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "h_thickness") );
+    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->t_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "t_length") );
+    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "t_length");
+    self->model->t_length.dispersion->accept_as_destination(visitor, self->model->t_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "h_thickness");
+    self->model->h_thickness.dispersion->accept_as_destination(visitor, self->model->h_thickness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CLamellarFFHGModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->h_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "h_thickness") );
+    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->t_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "t_length") );
+    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "t_length");
+    self->model->t_length.dispersion->accept_as_destination(visitor, self->model->t_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "h_thickness");
+    self->model->h_thickness.dispersion->accept_as_destination(visitor, self->model->h_thickness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CLamellarFFHGModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->h_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "h_thickness") );
+    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->t_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "t_length") );
+    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "t_length");
+    self->model->t_length.dispersion->accept_as_destination(visitor, self->model->t_length.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "h_thickness");
+    self->model->h_thickness.dispersion->accept_as_destination(visitor, self->model->h_thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarFFHGModelError, 
+	    	"CLamellarFFHGModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLamellarFFHGModelError, 
+	    		"CLamellarFFHGModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CLamellarFFHGModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CLamellarFFHGModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CLamellarFFHGModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CLamellarFFHGModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CLamellarFFHGModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CLamellarFFHGModelError,
+	    	"CLamellarFFHGModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "t_length")) {
+        self->model->t_length.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "h_thickness")) {
+        self->model->h_thickness.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CLamellarFFHGModelError,
+	    	"CLamellarFFHGModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CLamellarFFHGModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CLamellarFFHGModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CLamellarFFHGModel",             /*tp_name*/
+    sizeof(CLamellarFFHGModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CLamellarFFHGModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CLamellarFFHGModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CLamellarFFHGModel_methods,             /* tp_methods */
+    CLamellarFFHGModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CLamellarFFHGModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CLamellarFFHGModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCLamellarFFHGModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CLamellarFFHGModelType) < 0)
+        return;
+
+    Py_INCREF(&CLamellarFFHGModelType);
+    PyModule_AddObject(module, "CLamellarFFHGModel", (PyObject *)&CLamellarFFHGModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CLamellarFFHGModel.error";
+    CLamellarFFHGModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CLamellarFFHGModelError", CLamellarFFHGModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CLamellarModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CLamellarModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CLamellarModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,582 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CLamellarModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\lamellar.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "lamellar.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CLamellarModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    LamellarModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CLamellarModel;
+
+
+static void
+CLamellarModel_dealloc(CLamellarModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CLamellarModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CLamellarModel *self;
+    
+    self = (CLamellarModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CLamellarModel_init(CLamellarModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new LamellarModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"sld_sol",Py_BuildValue("d",0.000006300000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"bi_thick",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_bi",Py_BuildValue("d",0.000001000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->bi_thick.dispersion->accept_as_source(visitor, self->model->bi_thick.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "bi_thick", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CLamellarModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CLamellarModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CLamellarModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CLamellarModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CLamellarModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(LamellarModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( LamellarModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CLamellarModelError, 
+                   "CLamellarModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CLamellarModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->bi_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bi_thick") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "bi_thick");
+    self->model->bi_thick.dispersion->accept_as_destination(visitor, self->model->bi_thick.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarModelError, 
+	    	"CLamellarModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CLamellarModelError, 
+                   "CLamellarModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CLamellarModelError, 
+	    		"CLamellarModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CLamellarModelError, 
+                   "CLamellarModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CLamellarModelError, 
+                   "CLamellarModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CLamellarModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->bi_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bi_thick") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "bi_thick");
+    self->model->bi_thick.dispersion->accept_as_destination(visitor, self->model->bi_thick.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarModelError, 
+	    	"CLamellarModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLamellarModelError, 
+	    		"CLamellarModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CLamellarModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CLamellarModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CLamellarModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CLamellarModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->bi_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bi_thick") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "bi_thick");
+    self->model->bi_thick.dispersion->accept_as_destination(visitor, self->model->bi_thick.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CLamellarModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->bi_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bi_thick") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "bi_thick");
+    self->model->bi_thick.dispersion->accept_as_destination(visitor, self->model->bi_thick.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CLamellarModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->bi_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bi_thick") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "bi_thick");
+    self->model->bi_thick.dispersion->accept_as_destination(visitor, self->model->bi_thick.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarModelError, 
+	    	"CLamellarModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLamellarModelError, 
+	    		"CLamellarModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CLamellarModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CLamellarModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CLamellarModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CLamellarModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CLamellarModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CLamellarModelError,
+	    	"CLamellarModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "bi_thick")) {
+        self->model->bi_thick.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CLamellarModelError,
+	    	"CLamellarModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CLamellarModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CLamellarModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CLamellarModel",             /*tp_name*/
+    sizeof(CLamellarModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CLamellarModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CLamellarModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CLamellarModel_methods,             /* tp_methods */
+    CLamellarModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CLamellarModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CLamellarModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCLamellarModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CLamellarModelType) < 0)
+        return;
+
+    Py_INCREF(&CLamellarModelType);
+    PyModule_AddObject(module, "CLamellarModel", (PyObject *)&CLamellarModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CLamellarModel.error";
+    CLamellarModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CLamellarModelError", CLamellarModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CLamellarPCrystalModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CLamellarPCrystalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CLamellarPCrystalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,600 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CLamellarPCrystalModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\lamellarPC.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "lamellarPC.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CLamellarPCrystalModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    LamellarPCrystalModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CLamellarPCrystalModel;
+
+
+static void
+CLamellarPCrystalModel_dealloc(CLamellarPCrystalModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CLamellarPCrystalModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CLamellarPCrystalModel *self;
+    
+    self = (CLamellarPCrystalModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CLamellarPCrystalModel_init(CLamellarPCrystalModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new LamellarPCrystalModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"Nlayers",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"spacing",Py_BuildValue("d",250.000000000000));
+        PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006340000));
+        PyDict_SetItemString(self->params,"thickness",Py_BuildValue("d",33.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"pd_spacing",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_layer",Py_BuildValue("d",0.000001000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->thickness.dispersion->accept_as_source(visitor, self->model->thickness.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thickness", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CLamellarPCrystalModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CLamellarPCrystalModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CLamellarPCrystalModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CLamellarPCrystalModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CLamellarPCrystalModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(LamellarPCrystalModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( LamellarPCrystalModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CLamellarPCrystalModelError, 
+                   "CLamellarPCrystalModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CLamellarPCrystalModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Nlayers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nlayers") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->pd_spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "pd_spacing") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_layer = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_layer") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarPCrystalModelError, 
+	    	"CLamellarPCrystalModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CLamellarPCrystalModelError, 
+                   "CLamellarPCrystalModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CLamellarPCrystalModelError, 
+	    		"CLamellarPCrystalModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CLamellarPCrystalModelError, 
+                   "CLamellarPCrystalModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CLamellarPCrystalModelError, 
+                   "CLamellarPCrystalModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CLamellarPCrystalModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Nlayers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nlayers") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->pd_spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "pd_spacing") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_layer = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_layer") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarPCrystalModelError, 
+	    	"CLamellarPCrystalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLamellarPCrystalModelError, 
+	    		"CLamellarPCrystalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CLamellarPCrystalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CLamellarPCrystalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CLamellarPCrystalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CLamellarPCrystalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Nlayers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nlayers") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->pd_spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "pd_spacing") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_layer = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_layer") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CLamellarPCrystalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Nlayers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nlayers") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->pd_spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "pd_spacing") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_layer = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_layer") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CLamellarPCrystalModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Nlayers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nlayers") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->pd_spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "pd_spacing") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_layer = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_layer") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarPCrystalModelError, 
+	    	"CLamellarPCrystalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLamellarPCrystalModelError, 
+	    		"CLamellarPCrystalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CLamellarPCrystalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CLamellarPCrystalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CLamellarPCrystalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CLamellarPCrystalModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CLamellarPCrystalModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CLamellarPCrystalModelError,
+	    	"CLamellarPCrystalModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "thickness")) {
+        self->model->thickness.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CLamellarPCrystalModelError,
+	    	"CLamellarPCrystalModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CLamellarPCrystalModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CLamellarPCrystalModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CLamellarPCrystalModel",             /*tp_name*/
+    sizeof(CLamellarPCrystalModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CLamellarPCrystalModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CLamellarPCrystalModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CLamellarPCrystalModel_methods,             /* tp_methods */
+    CLamellarPCrystalModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CLamellarPCrystalModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CLamellarPCrystalModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCLamellarPCrystalModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CLamellarPCrystalModelType) < 0)
+        return;
+
+    Py_INCREF(&CLamellarPCrystalModelType);
+    PyModule_AddObject(module, "CLamellarPCrystalModel", (PyObject *)&CLamellarPCrystalModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CLamellarPCrystalModel.error";
+    CLamellarPCrystalModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CLamellarPCrystalModelError", CLamellarPCrystalModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CLamellarPSHGModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CLamellarPSHGModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CLamellarPSHGModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,642 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CLamellarPSHGModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\lamellarPS_HG.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "lamellarPS_HG.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CLamellarPSHGModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    LamellarPSHGModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CLamellarPSHGModel;
+
+
+static void
+CLamellarPSHGModel_dealloc(CLamellarPSHGModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CLamellarPSHGModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CLamellarPSHGModel *self;
+    
+    self = (CLamellarPSHGModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CLamellarPSHGModel_init(CLamellarPSHGModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new LamellarPSHGModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"n_plates",Py_BuildValue("d",30.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"deltaT",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"spacing",Py_BuildValue("d",40.000000000000));
+        PyDict_SetItemString(self->params,"sld_tail",Py_BuildValue("d",0.000000400000));
+        PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006000000));
+        PyDict_SetItemString(self->params,"caille",Py_BuildValue("d",0.001000000000));
+        PyDict_SetItemString(self->params,"sld_head",Py_BuildValue("d",0.000002000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000000000));
+        PyDict_SetItemString(self->params,"deltaH",Py_BuildValue("d",2.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->deltaT.dispersion->accept_as_source(visitor, self->model->deltaT.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "deltaT", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->deltaH.dispersion->accept_as_source(visitor, self->model->deltaH.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "deltaH", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->spacing.dispersion->accept_as_source(visitor, self->model->spacing.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "spacing", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CLamellarPSHGModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CLamellarPSHGModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CLamellarPSHGModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CLamellarPSHGModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CLamellarPSHGModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(LamellarPSHGModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( LamellarPSHGModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CLamellarPSHGModelError, 
+                   "CLamellarPSHGModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CLamellarPSHGModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->n_plates = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_plates") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->deltaT = PyFloat_AsDouble( PyDict_GetItemString(self->params, "deltaT") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->caille = PyFloat_AsDouble( PyDict_GetItemString(self->params, "caille") );
+    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->deltaH = PyFloat_AsDouble( PyDict_GetItemString(self->params, "deltaH") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "deltaT");
+    self->model->deltaT.dispersion->accept_as_destination(visitor, self->model->deltaT.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "deltaH");
+    self->model->deltaH.dispersion->accept_as_destination(visitor, self->model->deltaH.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "spacing");
+    self->model->spacing.dispersion->accept_as_destination(visitor, self->model->spacing.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarPSHGModelError, 
+	    	"CLamellarPSHGModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CLamellarPSHGModelError, 
+                   "CLamellarPSHGModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CLamellarPSHGModelError, 
+	    		"CLamellarPSHGModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CLamellarPSHGModelError, 
+                   "CLamellarPSHGModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CLamellarPSHGModelError, 
+                   "CLamellarPSHGModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CLamellarPSHGModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->n_plates = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_plates") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->deltaT = PyFloat_AsDouble( PyDict_GetItemString(self->params, "deltaT") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->caille = PyFloat_AsDouble( PyDict_GetItemString(self->params, "caille") );
+    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->deltaH = PyFloat_AsDouble( PyDict_GetItemString(self->params, "deltaH") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "deltaT");
+    self->model->deltaT.dispersion->accept_as_destination(visitor, self->model->deltaT.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "deltaH");
+    self->model->deltaH.dispersion->accept_as_destination(visitor, self->model->deltaH.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "spacing");
+    self->model->spacing.dispersion->accept_as_destination(visitor, self->model->spacing.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarPSHGModelError, 
+	    	"CLamellarPSHGModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLamellarPSHGModelError, 
+	    		"CLamellarPSHGModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CLamellarPSHGModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CLamellarPSHGModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CLamellarPSHGModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CLamellarPSHGModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->n_plates = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_plates") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->deltaT = PyFloat_AsDouble( PyDict_GetItemString(self->params, "deltaT") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->caille = PyFloat_AsDouble( PyDict_GetItemString(self->params, "caille") );
+    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->deltaH = PyFloat_AsDouble( PyDict_GetItemString(self->params, "deltaH") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "deltaT");
+    self->model->deltaT.dispersion->accept_as_destination(visitor, self->model->deltaT.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "deltaH");
+    self->model->deltaH.dispersion->accept_as_destination(visitor, self->model->deltaH.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "spacing");
+    self->model->spacing.dispersion->accept_as_destination(visitor, self->model->spacing.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CLamellarPSHGModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->n_plates = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_plates") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->deltaT = PyFloat_AsDouble( PyDict_GetItemString(self->params, "deltaT") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->caille = PyFloat_AsDouble( PyDict_GetItemString(self->params, "caille") );
+    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->deltaH = PyFloat_AsDouble( PyDict_GetItemString(self->params, "deltaH") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "deltaT");
+    self->model->deltaT.dispersion->accept_as_destination(visitor, self->model->deltaT.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "deltaH");
+    self->model->deltaH.dispersion->accept_as_destination(visitor, self->model->deltaH.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "spacing");
+    self->model->spacing.dispersion->accept_as_destination(visitor, self->model->spacing.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CLamellarPSHGModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->n_plates = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_plates") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->deltaT = PyFloat_AsDouble( PyDict_GetItemString(self->params, "deltaT") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->sld_tail = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_tail") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->caille = PyFloat_AsDouble( PyDict_GetItemString(self->params, "caille") );
+    self->model->sld_head = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_head") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->deltaH = PyFloat_AsDouble( PyDict_GetItemString(self->params, "deltaH") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "deltaT");
+    self->model->deltaT.dispersion->accept_as_destination(visitor, self->model->deltaT.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "deltaH");
+    self->model->deltaH.dispersion->accept_as_destination(visitor, self->model->deltaH.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "spacing");
+    self->model->spacing.dispersion->accept_as_destination(visitor, self->model->spacing.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarPSHGModelError, 
+	    	"CLamellarPSHGModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLamellarPSHGModelError, 
+	    		"CLamellarPSHGModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CLamellarPSHGModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CLamellarPSHGModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CLamellarPSHGModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CLamellarPSHGModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CLamellarPSHGModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CLamellarPSHGModelError,
+	    	"CLamellarPSHGModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "deltaT")) {
+        self->model->deltaT.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "deltaH")) {
+        self->model->deltaH.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "spacing")) {
+        self->model->spacing.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CLamellarPSHGModelError,
+	    	"CLamellarPSHGModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CLamellarPSHGModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CLamellarPSHGModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CLamellarPSHGModel",             /*tp_name*/
+    sizeof(CLamellarPSHGModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CLamellarPSHGModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CLamellarPSHGModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CLamellarPSHGModel_methods,             /* tp_methods */
+    CLamellarPSHGModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CLamellarPSHGModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CLamellarPSHGModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCLamellarPSHGModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CLamellarPSHGModelType) < 0)
+        return;
+
+    Py_INCREF(&CLamellarPSHGModelType);
+    PyModule_AddObject(module, "CLamellarPSHGModel", (PyObject *)&CLamellarPSHGModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CLamellarPSHGModel.error";
+    CLamellarPSHGModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CLamellarPSHGModelError", CLamellarPSHGModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CLamellarPSModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CLamellarPSModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CLamellarPSModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,615 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CLamellarPSModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\lamellarPS.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "lamellarPS.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CLamellarPSModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    LamellarPSModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CLamellarPSModel;
+
+
+static void
+CLamellarPSModel_dealloc(CLamellarPSModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CLamellarPSModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CLamellarPSModel *self;
+    
+    self = (CLamellarPSModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CLamellarPSModel_init(CLamellarPSModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new LamellarPSModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"n_plates",Py_BuildValue("d",20.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sld_sol",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"delta",Py_BuildValue("d",30.000000000000));
+        PyDict_SetItemString(self->params,"spacing",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"caille",Py_BuildValue("d",0.100000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_bi",Py_BuildValue("d",0.000006300000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->delta.dispersion->accept_as_source(visitor, self->model->delta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "delta", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->spacing.dispersion->accept_as_source(visitor, self->model->spacing.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "spacing", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CLamellarPSModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CLamellarPSModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CLamellarPSModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CLamellarPSModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CLamellarPSModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(LamellarPSModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( LamellarPSModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CLamellarPSModelError, 
+                   "CLamellarPSModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CLamellarPSModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->n_plates = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_plates") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
+    self->model->delta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->caille = PyFloat_AsDouble( PyDict_GetItemString(self->params, "caille") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "delta");
+    self->model->delta.dispersion->accept_as_destination(visitor, self->model->delta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "spacing");
+    self->model->spacing.dispersion->accept_as_destination(visitor, self->model->spacing.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarPSModelError, 
+	    	"CLamellarPSModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CLamellarPSModelError, 
+                   "CLamellarPSModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CLamellarPSModelError, 
+	    		"CLamellarPSModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CLamellarPSModelError, 
+                   "CLamellarPSModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CLamellarPSModelError, 
+                   "CLamellarPSModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CLamellarPSModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->n_plates = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_plates") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
+    self->model->delta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->caille = PyFloat_AsDouble( PyDict_GetItemString(self->params, "caille") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "delta");
+    self->model->delta.dispersion->accept_as_destination(visitor, self->model->delta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "spacing");
+    self->model->spacing.dispersion->accept_as_destination(visitor, self->model->spacing.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarPSModelError, 
+	    	"CLamellarPSModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLamellarPSModelError, 
+	    		"CLamellarPSModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CLamellarPSModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CLamellarPSModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CLamellarPSModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CLamellarPSModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->n_plates = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_plates") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
+    self->model->delta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->caille = PyFloat_AsDouble( PyDict_GetItemString(self->params, "caille") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "delta");
+    self->model->delta.dispersion->accept_as_destination(visitor, self->model->delta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "spacing");
+    self->model->spacing.dispersion->accept_as_destination(visitor, self->model->spacing.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CLamellarPSModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->n_plates = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_plates") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
+    self->model->delta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->caille = PyFloat_AsDouble( PyDict_GetItemString(self->params, "caille") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "delta");
+    self->model->delta.dispersion->accept_as_destination(visitor, self->model->delta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "spacing");
+    self->model->spacing.dispersion->accept_as_destination(visitor, self->model->spacing.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CLamellarPSModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->n_plates = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_plates") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sld_sol = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_sol") );
+    self->model->delta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta") );
+    self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") );
+    self->model->caille = PyFloat_AsDouble( PyDict_GetItemString(self->params, "caille") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_bi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bi") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "delta");
+    self->model->delta.dispersion->accept_as_destination(visitor, self->model->delta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "spacing");
+    self->model->spacing.dispersion->accept_as_destination(visitor, self->model->spacing.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLamellarPSModelError, 
+	    	"CLamellarPSModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLamellarPSModelError, 
+	    		"CLamellarPSModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CLamellarPSModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CLamellarPSModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CLamellarPSModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CLamellarPSModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CLamellarPSModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CLamellarPSModelError,
+	    	"CLamellarPSModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "delta")) {
+        self->model->delta.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "spacing")) {
+        self->model->spacing.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CLamellarPSModelError,
+	    	"CLamellarPSModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CLamellarPSModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CLamellarPSModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CLamellarPSModel",             /*tp_name*/
+    sizeof(CLamellarPSModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CLamellarPSModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CLamellarPSModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CLamellarPSModel_methods,             /* tp_methods */
+    CLamellarPSModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CLamellarPSModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CLamellarPSModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCLamellarPSModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CLamellarPSModelType) < 0)
+        return;
+
+    Py_INCREF(&CLamellarPSModelType);
+    PyModule_AddObject(module, "CLamellarPSModel", (PyObject *)&CLamellarPSModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CLamellarPSModel.error";
+    CLamellarPSModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CLamellarPSModelError", CLamellarPSModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CLinearPearlsModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CLinearPearlsModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CLinearPearlsModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,609 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CLinearPearlsModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\linearpearls.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "linearpearls.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CLinearPearlsModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    LinearPearlsModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CLinearPearlsModel;
+
+
+static void
+CLinearPearlsModel_dealloc(CLinearPearlsModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CLinearPearlsModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CLinearPearlsModel *self;
+    
+    self = (CLinearPearlsModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CLinearPearlsModel_init(CLinearPearlsModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new LinearPearlsModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"num_pearls",Py_BuildValue("d",3.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"edge_separation",Py_BuildValue("d",350.000000000000));
+        PyDict_SetItemString(self->params,"sld_pearl",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",80.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000006300000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->edge_separation.dispersion->accept_as_source(visitor, self->model->edge_separation.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "edge_separation", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CLinearPearlsModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CLinearPearlsModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CLinearPearlsModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CLinearPearlsModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CLinearPearlsModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(LinearPearlsModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( LinearPearlsModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CLinearPearlsModelError, 
+                   "CLinearPearlsModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CLinearPearlsModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->num_pearls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "num_pearls") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->edge_separation = PyFloat_AsDouble( PyDict_GetItemString(self->params, "edge_separation") );
+    self->model->sld_pearl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pearl") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "edge_separation");
+    self->model->edge_separation.dispersion->accept_as_destination(visitor, self->model->edge_separation.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLinearPearlsModelError, 
+	    	"CLinearPearlsModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CLinearPearlsModelError, 
+                   "CLinearPearlsModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CLinearPearlsModelError, 
+	    		"CLinearPearlsModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CLinearPearlsModelError, 
+                   "CLinearPearlsModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CLinearPearlsModelError, 
+                   "CLinearPearlsModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CLinearPearlsModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->num_pearls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "num_pearls") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->edge_separation = PyFloat_AsDouble( PyDict_GetItemString(self->params, "edge_separation") );
+    self->model->sld_pearl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pearl") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "edge_separation");
+    self->model->edge_separation.dispersion->accept_as_destination(visitor, self->model->edge_separation.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLinearPearlsModelError, 
+	    	"CLinearPearlsModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLinearPearlsModelError, 
+	    		"CLinearPearlsModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CLinearPearlsModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CLinearPearlsModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CLinearPearlsModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CLinearPearlsModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->num_pearls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "num_pearls") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->edge_separation = PyFloat_AsDouble( PyDict_GetItemString(self->params, "edge_separation") );
+    self->model->sld_pearl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pearl") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "edge_separation");
+    self->model->edge_separation.dispersion->accept_as_destination(visitor, self->model->edge_separation.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CLinearPearlsModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->num_pearls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "num_pearls") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->edge_separation = PyFloat_AsDouble( PyDict_GetItemString(self->params, "edge_separation") );
+    self->model->sld_pearl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pearl") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "edge_separation");
+    self->model->edge_separation.dispersion->accept_as_destination(visitor, self->model->edge_separation.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CLinearPearlsModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->num_pearls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "num_pearls") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->edge_separation = PyFloat_AsDouble( PyDict_GetItemString(self->params, "edge_separation") );
+    self->model->sld_pearl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pearl") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "edge_separation");
+    self->model->edge_separation.dispersion->accept_as_destination(visitor, self->model->edge_separation.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLinearPearlsModelError, 
+	    	"CLinearPearlsModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLinearPearlsModelError, 
+	    		"CLinearPearlsModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CLinearPearlsModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CLinearPearlsModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CLinearPearlsModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CLinearPearlsModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CLinearPearlsModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CLinearPearlsModelError,
+	    	"CLinearPearlsModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "edge_separation")) {
+        self->model->edge_separation.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CLinearPearlsModelError,
+	    	"CLinearPearlsModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CLinearPearlsModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CLinearPearlsModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CLinearPearlsModel",             /*tp_name*/
+    sizeof(CLinearPearlsModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CLinearPearlsModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CLinearPearlsModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CLinearPearlsModel_methods,             /* tp_methods */
+    CLinearPearlsModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CLinearPearlsModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CLinearPearlsModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCLinearPearlsModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CLinearPearlsModelType) < 0)
+        return;
+
+    Py_INCREF(&CLinearPearlsModelType);
+    PyModule_AddObject(module, "CLinearPearlsModel", (PyObject *)&CLinearPearlsModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CLinearPearlsModel.error";
+    CLinearPearlsModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CLinearPearlsModelError", CLinearPearlsModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CLogNormal.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CLogNormal.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CLogNormal.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,537 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CLogNormal
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\logNormal.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "logNormal.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CLogNormalError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    LogNormal * model;
+    /// Log for unit testing
+    PyObject * log;
+} CLogNormal;
+
+
+static void
+CLogNormal_dealloc(CLogNormal* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CLogNormal_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CLogNormal *self;
+    
+    self = (CLogNormal *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CLogNormal_init(CLogNormal *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new LogNormal();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sigma",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"center",Py_BuildValue("d",0.000000000000));
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CLogNormal_members[] = {
+    {name_params, T_OBJECT, offsetof(CLogNormal, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CLogNormal, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CLogNormal, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CLogNormal_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(LogNormal* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( LogNormal* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CLogNormalError, 
+                   "CLogNormal.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CLogNormal *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLogNormalError, 
+	    	"CLogNormal.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CLogNormalError, 
+                   "CLogNormal.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CLogNormalError, 
+	    		"CLogNormal.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CLogNormalError, 
+                   "CLogNormal.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CLogNormalError, 
+                   "CLogNormal.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CLogNormal *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLogNormalError, 
+	    	"CLogNormal.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLogNormalError, 
+	    		"CLogNormal.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CLogNormal_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CLogNormal_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CLogNormal_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CLogNormal *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CLogNormal *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CLogNormal *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLogNormalError, 
+	    	"CLogNormal.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLogNormalError, 
+	    		"CLogNormal.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CLogNormal_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CLogNormal_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CLogNormal_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CLogNormal *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CLogNormal *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CLogNormalError,
+	    	"CLogNormal.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+ {
+	    PyErr_SetString(CLogNormalError,
+	    	"CLogNormal.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CLogNormal_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CLogNormalType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CLogNormal",             /*tp_name*/
+    sizeof(CLogNormal),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CLogNormal_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CLogNormal objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CLogNormal_methods,             /* tp_methods */
+    CLogNormal_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CLogNormal_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CLogNormal_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCLogNormal(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CLogNormalType) < 0)
+        return;
+
+    Py_INCREF(&CLogNormalType);
+    PyModule_AddObject(module, "CLogNormal", (PyObject *)&CLogNormalType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CLogNormal.error";
+    CLogNormalError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CLogNormalError", CLogNormalError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CLorentzian.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CLorentzian.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CLorentzian.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,537 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CLorentzian
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\lorentzian.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "lorentzian.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CLorentzianError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    Lorentzian * model;
+    /// Log for unit testing
+    PyObject * log;
+} CLorentzian;
+
+
+static void
+CLorentzian_dealloc(CLorentzian* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CLorentzian_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CLorentzian *self;
+    
+    self = (CLorentzian *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CLorentzian_init(CLorentzian *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new Lorentzian();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"center",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"gamma",Py_BuildValue("d",1.000000000000));
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CLorentzian_members[] = {
+    {name_params, T_OBJECT, offsetof(CLorentzian, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CLorentzian, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CLorentzian, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CLorentzian_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(Lorentzian* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( Lorentzian* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CLorentzianError, 
+                   "CLorentzian.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CLorentzian *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+    self->model->gamma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "gamma") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLorentzianError, 
+	    	"CLorentzian.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CLorentzianError, 
+                   "CLorentzian.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CLorentzianError, 
+	    		"CLorentzian.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CLorentzianError, 
+                   "CLorentzian.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CLorentzianError, 
+                   "CLorentzian.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CLorentzian *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+    self->model->gamma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "gamma") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLorentzianError, 
+	    	"CLorentzian.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLorentzianError, 
+	    		"CLorentzian.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CLorentzian_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CLorentzian_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CLorentzian_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CLorentzian *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+    self->model->gamma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "gamma") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CLorentzian *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+    self->model->gamma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "gamma") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CLorentzian *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+    self->model->gamma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "gamma") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CLorentzianError, 
+	    	"CLorentzian.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CLorentzianError, 
+	    		"CLorentzian.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CLorentzian_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CLorentzian_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CLorentzian_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CLorentzian *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CLorentzian *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CLorentzianError,
+	    	"CLorentzian.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+ {
+	    PyErr_SetString(CLorentzianError,
+	    	"CLorentzian.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CLorentzian_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CLorentzianType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CLorentzian",             /*tp_name*/
+    sizeof(CLorentzian),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CLorentzian_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CLorentzian objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CLorentzian_methods,             /* tp_methods */
+    CLorentzian_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CLorentzian_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CLorentzian_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCLorentzian(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CLorentzianType) < 0)
+        return;
+
+    Py_INCREF(&CLorentzianType);
+    PyModule_AddObject(module, "CLorentzian", (PyObject *)&CLorentzianType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CLorentzian.error";
+    CLorentzianError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CLorentzianError", CLorentzianError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CMassFractalModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CMassFractalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CMassFractalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,549 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CMassFractalModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\massfractal.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "massfractal.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CMassFractalModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    MassFractalModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CMassFractalModel;
+
+
+static void
+CMassFractalModel_dealloc(CMassFractalModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CMassFractalModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CMassFractalModel *self;
+    
+    self = (CMassFractalModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CMassFractalModel_init(CMassFractalModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new MassFractalModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"co_length",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"mass_dim",Py_BuildValue("d",1.900000000000));
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CMassFractalModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CMassFractalModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CMassFractalModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CMassFractalModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CMassFractalModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(MassFractalModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( MassFractalModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CMassFractalModelError, 
+                   "CMassFractalModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CMassFractalModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->co_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "co_length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->mass_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "mass_dim") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CMassFractalModelError, 
+	    	"CMassFractalModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CMassFractalModelError, 
+                   "CMassFractalModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CMassFractalModelError, 
+	    		"CMassFractalModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CMassFractalModelError, 
+                   "CMassFractalModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CMassFractalModelError, 
+                   "CMassFractalModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CMassFractalModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->co_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "co_length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->mass_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "mass_dim") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CMassFractalModelError, 
+	    	"CMassFractalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CMassFractalModelError, 
+	    		"CMassFractalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CMassFractalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CMassFractalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CMassFractalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CMassFractalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->co_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "co_length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->mass_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "mass_dim") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CMassFractalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->co_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "co_length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->mass_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "mass_dim") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CMassFractalModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->co_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "co_length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->mass_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "mass_dim") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CMassFractalModelError, 
+	    	"CMassFractalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CMassFractalModelError, 
+	    		"CMassFractalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CMassFractalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CMassFractalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CMassFractalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CMassFractalModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CMassFractalModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CMassFractalModelError,
+	    	"CMassFractalModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+ {
+	    PyErr_SetString(CMassFractalModelError,
+	    	"CMassFractalModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CMassFractalModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CMassFractalModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CMassFractalModel",             /*tp_name*/
+    sizeof(CMassFractalModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CMassFractalModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CMassFractalModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CMassFractalModel_methods,             /* tp_methods */
+    CMassFractalModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CMassFractalModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CMassFractalModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCMassFractalModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CMassFractalModelType) < 0)
+        return;
+
+    Py_INCREF(&CMassFractalModelType);
+    PyModule_AddObject(module, "CMassFractalModel", (PyObject *)&CMassFractalModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CMassFractalModel.error";
+    CMassFractalModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CMassFractalModelError", CMassFractalModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CMassSurfaceFractal.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CMassSurfaceFractal.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CMassSurfaceFractal.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,555 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CMassSurfaceFractal
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\masssurfacefractal.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "masssurfacefractal.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CMassSurfaceFractalError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    MassSurfaceFractal * model;
+    /// Log for unit testing
+    PyObject * log;
+} CMassSurfaceFractal;
+
+
+static void
+CMassSurfaceFractal_dealloc(CMassSurfaceFractal* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CMassSurfaceFractal_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CMassSurfaceFractal *self;
+    
+    self = (CMassSurfaceFractal *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CMassSurfaceFractal_init(CMassSurfaceFractal *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new MassSurfaceFractal();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"cluster_rg",Py_BuildValue("d",86.700000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"mass_dim",Py_BuildValue("d",1.800000000000));
+        PyDict_SetItemString(self->params,"surface_dim",Py_BuildValue("d",2.300000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"primary_rg",Py_BuildValue("d",4000.000000000000));
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CMassSurfaceFractal_members[] = {
+    {name_params, T_OBJECT, offsetof(CMassSurfaceFractal, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CMassSurfaceFractal, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CMassSurfaceFractal, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CMassSurfaceFractal_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(MassSurfaceFractal* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( MassSurfaceFractal* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CMassSurfaceFractalError, 
+                   "CMassSurfaceFractal.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CMassSurfaceFractal *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->cluster_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cluster_rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->mass_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "mass_dim") );
+    self->model->surface_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surface_dim") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->primary_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "primary_rg") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CMassSurfaceFractalError, 
+	    	"CMassSurfaceFractal.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CMassSurfaceFractalError, 
+                   "CMassSurfaceFractal.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CMassSurfaceFractalError, 
+	    		"CMassSurfaceFractal.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CMassSurfaceFractalError, 
+                   "CMassSurfaceFractal.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CMassSurfaceFractalError, 
+                   "CMassSurfaceFractal.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CMassSurfaceFractal *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->cluster_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cluster_rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->mass_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "mass_dim") );
+    self->model->surface_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surface_dim") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->primary_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "primary_rg") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CMassSurfaceFractalError, 
+	    	"CMassSurfaceFractal.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CMassSurfaceFractalError, 
+	    		"CMassSurfaceFractal.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CMassSurfaceFractal_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CMassSurfaceFractal_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CMassSurfaceFractal_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CMassSurfaceFractal *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->cluster_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cluster_rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->mass_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "mass_dim") );
+    self->model->surface_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surface_dim") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->primary_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "primary_rg") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CMassSurfaceFractal *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->cluster_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cluster_rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->mass_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "mass_dim") );
+    self->model->surface_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surface_dim") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->primary_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "primary_rg") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CMassSurfaceFractal *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->cluster_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "cluster_rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->mass_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "mass_dim") );
+    self->model->surface_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surface_dim") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->primary_rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "primary_rg") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CMassSurfaceFractalError, 
+	    	"CMassSurfaceFractal.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CMassSurfaceFractalError, 
+	    		"CMassSurfaceFractal.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CMassSurfaceFractal_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CMassSurfaceFractal_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CMassSurfaceFractal_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CMassSurfaceFractal *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CMassSurfaceFractal *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CMassSurfaceFractalError,
+	    	"CMassSurfaceFractal.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+ {
+	    PyErr_SetString(CMassSurfaceFractalError,
+	    	"CMassSurfaceFractal.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CMassSurfaceFractal_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CMassSurfaceFractalType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CMassSurfaceFractal",             /*tp_name*/
+    sizeof(CMassSurfaceFractal),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CMassSurfaceFractal_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CMassSurfaceFractal objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CMassSurfaceFractal_methods,             /* tp_methods */
+    CMassSurfaceFractal_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CMassSurfaceFractal_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CMassSurfaceFractal_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCMassSurfaceFractal(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CMassSurfaceFractalType) < 0)
+        return;
+
+    Py_INCREF(&CMassSurfaceFractalType);
+    PyModule_AddObject(module, "CMassSurfaceFractal", (PyObject *)&CMassSurfaceFractalType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CMassSurfaceFractal.error";
+    CMassSurfaceFractalError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CMassSurfaceFractalError", CMassSurfaceFractalError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CMicelleSphCoreModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CMicelleSphCoreModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CMicelleSphCoreModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,639 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CMicelleSphCoreModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\micelleSphCore.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "micelleSphCore.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CMicelleSphCoreModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    MicelleSphCoreModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CMicelleSphCoreModel;
+
+
+static void
+CMicelleSphCoreModel_dealloc(CMicelleSphCoreModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CMicelleSphCoreModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CMicelleSphCoreModel *self;
+    
+    self = (CMicelleSphCoreModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CMicelleSphCoreModel_init(CMicelleSphCoreModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new MicelleSphCoreModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"v_core",Py_BuildValue("d",62624.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"v_corona",Py_BuildValue("d",61940.000000000000));
+        PyDict_SetItemString(self->params,"n_aggreg",Py_BuildValue("d",6.000000000000));
+        PyDict_SetItemString(self->params,"rho_corona",Py_BuildValue("d",0.000000800000));
+        PyDict_SetItemString(self->params,"rho_core",Py_BuildValue("d",0.000000340000));
+        PyDict_SetItemString(self->params,"d_penetration",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"ndensity",Py_BuildValue("d",8940000000000000.000000000000));
+        PyDict_SetItemString(self->params,"rho_solv",Py_BuildValue("d",0.000006400000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"radius_core",Py_BuildValue("d",45.000000000000));
+        PyDict_SetItemString(self->params,"radius_gyr",Py_BuildValue("d",20.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius_core.dispersion->accept_as_source(visitor, self->model->radius_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->radius_gyr.dispersion->accept_as_source(visitor, self->model->radius_gyr.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius_gyr", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CMicelleSphCoreModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CMicelleSphCoreModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CMicelleSphCoreModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CMicelleSphCoreModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CMicelleSphCoreModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(MicelleSphCoreModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( MicelleSphCoreModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CMicelleSphCoreModelError, 
+                   "CMicelleSphCoreModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CMicelleSphCoreModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->v_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "v_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->v_corona = PyFloat_AsDouble( PyDict_GetItemString(self->params, "v_corona") );
+    self->model->n_aggreg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_aggreg") );
+    self->model->rho_corona = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_corona") );
+    self->model->rho_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_core") );
+    self->model->d_penetration = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_penetration") );
+    self->model->ndensity = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ndensity") );
+    self->model->rho_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_solv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_core") );
+    self->model->radius_gyr = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_gyr") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_core");
+    self->model->radius_core.dispersion->accept_as_destination(visitor, self->model->radius_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_gyr");
+    self->model->radius_gyr.dispersion->accept_as_destination(visitor, self->model->radius_gyr.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CMicelleSphCoreModelError, 
+	    	"CMicelleSphCoreModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CMicelleSphCoreModelError, 
+                   "CMicelleSphCoreModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CMicelleSphCoreModelError, 
+	    		"CMicelleSphCoreModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CMicelleSphCoreModelError, 
+                   "CMicelleSphCoreModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CMicelleSphCoreModelError, 
+                   "CMicelleSphCoreModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CMicelleSphCoreModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->v_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "v_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->v_corona = PyFloat_AsDouble( PyDict_GetItemString(self->params, "v_corona") );
+    self->model->n_aggreg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_aggreg") );
+    self->model->rho_corona = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_corona") );
+    self->model->rho_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_core") );
+    self->model->d_penetration = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_penetration") );
+    self->model->ndensity = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ndensity") );
+    self->model->rho_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_solv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_core") );
+    self->model->radius_gyr = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_gyr") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_core");
+    self->model->radius_core.dispersion->accept_as_destination(visitor, self->model->radius_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_gyr");
+    self->model->radius_gyr.dispersion->accept_as_destination(visitor, self->model->radius_gyr.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CMicelleSphCoreModelError, 
+	    	"CMicelleSphCoreModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CMicelleSphCoreModelError, 
+	    		"CMicelleSphCoreModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CMicelleSphCoreModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CMicelleSphCoreModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CMicelleSphCoreModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CMicelleSphCoreModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->v_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "v_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->v_corona = PyFloat_AsDouble( PyDict_GetItemString(self->params, "v_corona") );
+    self->model->n_aggreg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_aggreg") );
+    self->model->rho_corona = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_corona") );
+    self->model->rho_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_core") );
+    self->model->d_penetration = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_penetration") );
+    self->model->ndensity = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ndensity") );
+    self->model->rho_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_solv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_core") );
+    self->model->radius_gyr = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_gyr") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_core");
+    self->model->radius_core.dispersion->accept_as_destination(visitor, self->model->radius_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_gyr");
+    self->model->radius_gyr.dispersion->accept_as_destination(visitor, self->model->radius_gyr.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CMicelleSphCoreModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->v_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "v_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->v_corona = PyFloat_AsDouble( PyDict_GetItemString(self->params, "v_corona") );
+    self->model->n_aggreg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_aggreg") );
+    self->model->rho_corona = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_corona") );
+    self->model->rho_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_core") );
+    self->model->d_penetration = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_penetration") );
+    self->model->ndensity = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ndensity") );
+    self->model->rho_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_solv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_core") );
+    self->model->radius_gyr = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_gyr") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_core");
+    self->model->radius_core.dispersion->accept_as_destination(visitor, self->model->radius_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_gyr");
+    self->model->radius_gyr.dispersion->accept_as_destination(visitor, self->model->radius_gyr.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CMicelleSphCoreModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->v_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "v_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->v_corona = PyFloat_AsDouble( PyDict_GetItemString(self->params, "v_corona") );
+    self->model->n_aggreg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_aggreg") );
+    self->model->rho_corona = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_corona") );
+    self->model->rho_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_core") );
+    self->model->d_penetration = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_penetration") );
+    self->model->ndensity = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ndensity") );
+    self->model->rho_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rho_solv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->radius_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_core") );
+    self->model->radius_gyr = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_gyr") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_core");
+    self->model->radius_core.dispersion->accept_as_destination(visitor, self->model->radius_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_gyr");
+    self->model->radius_gyr.dispersion->accept_as_destination(visitor, self->model->radius_gyr.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CMicelleSphCoreModelError, 
+	    	"CMicelleSphCoreModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CMicelleSphCoreModelError, 
+	    		"CMicelleSphCoreModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CMicelleSphCoreModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CMicelleSphCoreModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CMicelleSphCoreModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CMicelleSphCoreModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CMicelleSphCoreModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CMicelleSphCoreModelError,
+	    	"CMicelleSphCoreModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius_core")) {
+        self->model->radius_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "radius_gyr")) {
+        self->model->radius_gyr.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CMicelleSphCoreModelError,
+	    	"CMicelleSphCoreModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CMicelleSphCoreModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CMicelleSphCoreModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CMicelleSphCoreModel",             /*tp_name*/
+    sizeof(CMicelleSphCoreModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CMicelleSphCoreModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CMicelleSphCoreModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CMicelleSphCoreModel_methods,             /* tp_methods */
+    CMicelleSphCoreModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CMicelleSphCoreModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CMicelleSphCoreModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCMicelleSphCoreModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CMicelleSphCoreModelType) < 0)
+        return;
+
+    Py_INCREF(&CMicelleSphCoreModelType);
+    PyModule_AddObject(module, "CMicelleSphCoreModel", (PyObject *)&CMicelleSphCoreModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CMicelleSphCoreModel.error";
+    CMicelleSphCoreModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CMicelleSphCoreModelError", CMicelleSphCoreModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CMultiShellModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CMultiShellModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CMultiShellModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,630 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CMultiShellModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\multishell.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "multishell.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CMultiShellModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    MultiShellModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CMultiShellModel;
+
+
+static void
+CMultiShellModel_dealloc(CMultiShellModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CMultiShellModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CMultiShellModel *self;
+    
+    self = (CMultiShellModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CMultiShellModel_init(CMultiShellModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new MultiShellModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"core_sld",Py_BuildValue("d",0.000006400000));
+        PyDict_SetItemString(self->params,"core_radius",Py_BuildValue("d",60.000000000000));
+        PyDict_SetItemString(self->params,"n_pairs",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"w_thickness",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"s_thickness",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"shell_sld",Py_BuildValue("d",0.000000400000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->core_radius.dispersion->accept_as_source(visitor, self->model->core_radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "core_radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->s_thickness.dispersion->accept_as_source(visitor, self->model->s_thickness.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "s_thickness", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->w_thickness.dispersion->accept_as_source(visitor, self->model->w_thickness.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "w_thickness", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CMultiShellModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CMultiShellModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CMultiShellModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CMultiShellModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CMultiShellModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(MultiShellModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( MultiShellModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CMultiShellModelError, 
+                   "CMultiShellModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CMultiShellModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );
+    self->model->n_pairs = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_pairs") );
+    self->model->w_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "w_thickness") );
+    self->model->s_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_thickness") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius");
+    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "s_thickness");
+    self->model->s_thickness.dispersion->accept_as_destination(visitor, self->model->s_thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "w_thickness");
+    self->model->w_thickness.dispersion->accept_as_destination(visitor, self->model->w_thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CMultiShellModelError, 
+	    	"CMultiShellModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CMultiShellModelError, 
+                   "CMultiShellModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CMultiShellModelError, 
+	    		"CMultiShellModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CMultiShellModelError, 
+                   "CMultiShellModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CMultiShellModelError, 
+                   "CMultiShellModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CMultiShellModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );
+    self->model->n_pairs = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_pairs") );
+    self->model->w_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "w_thickness") );
+    self->model->s_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_thickness") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius");
+    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "s_thickness");
+    self->model->s_thickness.dispersion->accept_as_destination(visitor, self->model->s_thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "w_thickness");
+    self->model->w_thickness.dispersion->accept_as_destination(visitor, self->model->w_thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CMultiShellModelError, 
+	    	"CMultiShellModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CMultiShellModelError, 
+	    		"CMultiShellModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CMultiShellModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CMultiShellModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CMultiShellModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CMultiShellModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );
+    self->model->n_pairs = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_pairs") );
+    self->model->w_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "w_thickness") );
+    self->model->s_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_thickness") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius");
+    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "s_thickness");
+    self->model->s_thickness.dispersion->accept_as_destination(visitor, self->model->s_thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "w_thickness");
+    self->model->w_thickness.dispersion->accept_as_destination(visitor, self->model->w_thickness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CMultiShellModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );
+    self->model->n_pairs = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_pairs") );
+    self->model->w_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "w_thickness") );
+    self->model->s_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_thickness") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius");
+    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "s_thickness");
+    self->model->s_thickness.dispersion->accept_as_destination(visitor, self->model->s_thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "w_thickness");
+    self->model->w_thickness.dispersion->accept_as_destination(visitor, self->model->w_thickness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CMultiShellModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );
+    self->model->n_pairs = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_pairs") );
+    self->model->w_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "w_thickness") );
+    self->model->s_thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_thickness") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_radius");
+    self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "s_thickness");
+    self->model->s_thickness.dispersion->accept_as_destination(visitor, self->model->s_thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "w_thickness");
+    self->model->w_thickness.dispersion->accept_as_destination(visitor, self->model->w_thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CMultiShellModelError, 
+	    	"CMultiShellModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CMultiShellModelError, 
+	    		"CMultiShellModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CMultiShellModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CMultiShellModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CMultiShellModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CMultiShellModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CMultiShellModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CMultiShellModelError,
+	    	"CMultiShellModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "core_radius")) {
+        self->model->core_radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "s_thickness")) {
+        self->model->s_thickness.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "w_thickness")) {
+        self->model->w_thickness.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CMultiShellModelError,
+	    	"CMultiShellModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CMultiShellModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CMultiShellModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CMultiShellModel",             /*tp_name*/
+    sizeof(CMultiShellModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CMultiShellModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CMultiShellModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CMultiShellModel_methods,             /* tp_methods */
+    CMultiShellModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CMultiShellModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CMultiShellModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCMultiShellModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CMultiShellModelType) < 0)
+        return;
+
+    Py_INCREF(&CMultiShellModelType);
+    PyModule_AddObject(module, "CMultiShellModel", (PyObject *)&CMultiShellModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CMultiShellModel.error";
+    CMultiShellModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CMultiShellModelError", CMultiShellModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/COnionModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/COnionModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/COnionModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,1038 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** COnionModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\onion.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "onion.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * COnionModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    OnionModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} COnionModel;
+
+
+static void
+COnionModel_dealloc(COnionModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+COnionModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    COnionModel *self;
+    
+    self = (COnionModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+COnionModel_init(COnionModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new OnionModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"thick_shell4",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_shell5",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_shell9",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_shell7",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"sld_core0",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"rad_core0",Py_BuildValue("d",200.000000000000));
+        PyDict_SetItemString(self->params,"A_shell10",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_shell1",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"func_shell4",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"func_shell5",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"func_shell6",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"func_shell1",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"thick_shell10",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"func_shell3",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"func_shell8",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"func_shell9",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"sld_in_shell5",Py_BuildValue("d",0.000003700000));
+        PyDict_SetItemString(self->params,"func_shell10",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"sld_in_shell4",Py_BuildValue("d",0.000003200000));
+        PyDict_SetItemString(self->params,"sld_in_shell7",Py_BuildValue("d",0.000004700000));
+        PyDict_SetItemString(self->params,"sld_out_shell9",Py_BuildValue("d",0.000006000000));
+        PyDict_SetItemString(self->params,"sld_out_shell8",Py_BuildValue("d",0.000005500000));
+        PyDict_SetItemString(self->params,"thick_shell6",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"sld_out_shell2",Py_BuildValue("d",0.000002500000));
+        PyDict_SetItemString(self->params,"sld_in_shell9",Py_BuildValue("d",0.000005700000));
+        PyDict_SetItemString(self->params,"sld_in_shell8",Py_BuildValue("d",0.000005200000));
+        PyDict_SetItemString(self->params,"thick_shell2",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_shell3",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"sld_out_shell1",Py_BuildValue("d",0.000002000000));
+        PyDict_SetItemString(self->params,"sld_out_shell5",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_out_shell3",Py_BuildValue("d",0.000003000000));
+        PyDict_SetItemString(self->params,"sld_in_shell6",Py_BuildValue("d",0.000004200000));
+        PyDict_SetItemString(self->params,"sld_in_shell1",Py_BuildValue("d",0.000001700000));
+        PyDict_SetItemString(self->params,"sld_out_shell4",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_in_shell3",Py_BuildValue("d",0.000002700000));
+        PyDict_SetItemString(self->params,"sld_out_shell6",Py_BuildValue("d",0.000004500000));
+        PyDict_SetItemString(self->params,"func_shell7",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"sld_out_shell7",Py_BuildValue("d",0.000005000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"n_shells",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sld_in_shell2",Py_BuildValue("d",0.000002200000));
+        PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000006400000));
+        PyDict_SetItemString(self->params,"func_shell2",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"thick_shell8",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"sld_out_shell10",Py_BuildValue("d",0.000006200000));
+        PyDict_SetItemString(self->params,"sld_in_shell10",Py_BuildValue("d",0.000006000000));
+        PyDict_SetItemString(self->params,"A_shell8",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"A_shell9",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"A_shell6",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"A_shell7",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"A_shell4",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"A_shell5",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"A_shell2",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"A_shell3",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"A_shell1",Py_BuildValue("d",1.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->rad_core0.dispersion->accept_as_source(visitor, self->model->rad_core0.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "rad_core0", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell1.dispersion->accept_as_source(visitor, self->model->thick_shell1.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell1", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell2.dispersion->accept_as_source(visitor, self->model->thick_shell2.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell2", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell3.dispersion->accept_as_source(visitor, self->model->thick_shell3.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell3", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell4.dispersion->accept_as_source(visitor, self->model->thick_shell4.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell4", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell5.dispersion->accept_as_source(visitor, self->model->thick_shell5.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell5", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell6.dispersion->accept_as_source(visitor, self->model->thick_shell6.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell6", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell7.dispersion->accept_as_source(visitor, self->model->thick_shell7.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell7", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell8.dispersion->accept_as_source(visitor, self->model->thick_shell8.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell8", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell9.dispersion->accept_as_source(visitor, self->model->thick_shell9.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell9", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_shell10.dispersion->accept_as_source(visitor, self->model->thick_shell10.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_shell10", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef COnionModel_members[] = {
+    {name_params, T_OBJECT, offsetof(COnionModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(COnionModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(COnionModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double COnionModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(OnionModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( OnionModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(COnionModelError, 
+                   "COnionModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(COnionModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell4") );
+    self->model->thick_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell5") );
+    self->model->thick_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell9") );
+    self->model->thick_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell7") );
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->A_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell10") );
+    self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") );
+    self->model->func_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell4") );
+    self->model->func_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell5") );
+    self->model->func_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell6") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->func_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell1") );
+    self->model->thick_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell10") );
+    self->model->func_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell3") );
+    self->model->func_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell8") );
+    self->model->func_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell9") );
+    self->model->sld_in_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell5") );
+    self->model->func_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell10") );
+    self->model->sld_in_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell4") );
+    self->model->sld_in_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell7") );
+    self->model->sld_out_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell9") );
+    self->model->sld_out_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell8") );
+    self->model->thick_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell6") );
+    self->model->sld_out_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell2") );
+    self->model->sld_in_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell9") );
+    self->model->sld_in_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell8") );
+    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") );
+    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );
+    self->model->sld_out_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell1") );
+    self->model->sld_out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") );
+    self->model->sld_out_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell3") );
+    self->model->sld_in_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell6") );
+    self->model->sld_in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") );
+    self->model->sld_out_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell4") );
+    self->model->sld_in_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell3") );
+    self->model->sld_out_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell6") );
+    self->model->func_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell7") );
+    self->model->sld_out_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell7") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->n_shells = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_shells") );
+    self->model->sld_in_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell2") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->func_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell2") );
+    self->model->thick_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell8") );
+    self->model->sld_out_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell10") );
+    self->model->sld_in_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell10") );
+    self->model->A_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell8") );
+    self->model->A_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell9") );
+    self->model->A_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell6") );
+    self->model->A_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell7") );
+    self->model->A_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell4") );
+    self->model->A_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell5") );
+    self->model->A_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell2") );
+    self->model->A_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell3") );
+    self->model->A_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell1") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1");
+    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell2");
+    self->model->thick_shell2.dispersion->accept_as_destination(visitor, self->model->thick_shell2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell3");
+    self->model->thick_shell3.dispersion->accept_as_destination(visitor, self->model->thick_shell3.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell4");
+    self->model->thick_shell4.dispersion->accept_as_destination(visitor, self->model->thick_shell4.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell5");
+    self->model->thick_shell5.dispersion->accept_as_destination(visitor, self->model->thick_shell5.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell6");
+    self->model->thick_shell6.dispersion->accept_as_destination(visitor, self->model->thick_shell6.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell7");
+    self->model->thick_shell7.dispersion->accept_as_destination(visitor, self->model->thick_shell7.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell8");
+    self->model->thick_shell8.dispersion->accept_as_destination(visitor, self->model->thick_shell8.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell9");
+    self->model->thick_shell9.dispersion->accept_as_destination(visitor, self->model->thick_shell9.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell10");
+    self->model->thick_shell10.dispersion->accept_as_destination(visitor, self->model->thick_shell10.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(COnionModelError, 
+	    	"COnionModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(COnionModelError, 
+                   "COnionModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(COnionModelError, 
+	    		"COnionModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(COnionModelError, 
+                   "COnionModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(COnionModelError, 
+                   "COnionModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(COnionModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell4") );
+    self->model->thick_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell5") );
+    self->model->thick_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell9") );
+    self->model->thick_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell7") );
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->A_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell10") );
+    self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") );
+    self->model->func_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell4") );
+    self->model->func_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell5") );
+    self->model->func_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell6") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->func_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell1") );
+    self->model->thick_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell10") );
+    self->model->func_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell3") );
+    self->model->func_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell8") );
+    self->model->func_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell9") );
+    self->model->sld_in_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell5") );
+    self->model->func_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell10") );
+    self->model->sld_in_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell4") );
+    self->model->sld_in_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell7") );
+    self->model->sld_out_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell9") );
+    self->model->sld_out_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell8") );
+    self->model->thick_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell6") );
+    self->model->sld_out_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell2") );
+    self->model->sld_in_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell9") );
+    self->model->sld_in_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell8") );
+    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") );
+    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );
+    self->model->sld_out_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell1") );
+    self->model->sld_out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") );
+    self->model->sld_out_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell3") );
+    self->model->sld_in_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell6") );
+    self->model->sld_in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") );
+    self->model->sld_out_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell4") );
+    self->model->sld_in_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell3") );
+    self->model->sld_out_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell6") );
+    self->model->func_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell7") );
+    self->model->sld_out_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell7") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->n_shells = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_shells") );
+    self->model->sld_in_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell2") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->func_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell2") );
+    self->model->thick_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell8") );
+    self->model->sld_out_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell10") );
+    self->model->sld_in_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell10") );
+    self->model->A_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell8") );
+    self->model->A_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell9") );
+    self->model->A_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell6") );
+    self->model->A_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell7") );
+    self->model->A_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell4") );
+    self->model->A_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell5") );
+    self->model->A_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell2") );
+    self->model->A_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell3") );
+    self->model->A_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell1") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1");
+    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell2");
+    self->model->thick_shell2.dispersion->accept_as_destination(visitor, self->model->thick_shell2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell3");
+    self->model->thick_shell3.dispersion->accept_as_destination(visitor, self->model->thick_shell3.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell4");
+    self->model->thick_shell4.dispersion->accept_as_destination(visitor, self->model->thick_shell4.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell5");
+    self->model->thick_shell5.dispersion->accept_as_destination(visitor, self->model->thick_shell5.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell6");
+    self->model->thick_shell6.dispersion->accept_as_destination(visitor, self->model->thick_shell6.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell7");
+    self->model->thick_shell7.dispersion->accept_as_destination(visitor, self->model->thick_shell7.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell8");
+    self->model->thick_shell8.dispersion->accept_as_destination(visitor, self->model->thick_shell8.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell9");
+    self->model->thick_shell9.dispersion->accept_as_destination(visitor, self->model->thick_shell9.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell10");
+    self->model->thick_shell10.dispersion->accept_as_destination(visitor, self->model->thick_shell10.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(COnionModelError, 
+	    	"COnionModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(COnionModelError, 
+	    		"COnionModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = COnionModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = COnionModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = COnionModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(COnionModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell4") );
+    self->model->thick_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell5") );
+    self->model->thick_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell9") );
+    self->model->thick_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell7") );
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->A_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell10") );
+    self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") );
+    self->model->func_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell4") );
+    self->model->func_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell5") );
+    self->model->func_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell6") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->func_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell1") );
+    self->model->thick_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell10") );
+    self->model->func_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell3") );
+    self->model->func_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell8") );
+    self->model->func_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell9") );
+    self->model->sld_in_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell5") );
+    self->model->func_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell10") );
+    self->model->sld_in_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell4") );
+    self->model->sld_in_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell7") );
+    self->model->sld_out_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell9") );
+    self->model->sld_out_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell8") );
+    self->model->thick_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell6") );
+    self->model->sld_out_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell2") );
+    self->model->sld_in_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell9") );
+    self->model->sld_in_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell8") );
+    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") );
+    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );
+    self->model->sld_out_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell1") );
+    self->model->sld_out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") );
+    self->model->sld_out_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell3") );
+    self->model->sld_in_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell6") );
+    self->model->sld_in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") );
+    self->model->sld_out_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell4") );
+    self->model->sld_in_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell3") );
+    self->model->sld_out_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell6") );
+    self->model->func_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell7") );
+    self->model->sld_out_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell7") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->n_shells = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_shells") );
+    self->model->sld_in_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell2") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->func_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell2") );
+    self->model->thick_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell8") );
+    self->model->sld_out_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell10") );
+    self->model->sld_in_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell10") );
+    self->model->A_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell8") );
+    self->model->A_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell9") );
+    self->model->A_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell6") );
+    self->model->A_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell7") );
+    self->model->A_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell4") );
+    self->model->A_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell5") );
+    self->model->A_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell2") );
+    self->model->A_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell3") );
+    self->model->A_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell1") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1");
+    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell2");
+    self->model->thick_shell2.dispersion->accept_as_destination(visitor, self->model->thick_shell2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell3");
+    self->model->thick_shell3.dispersion->accept_as_destination(visitor, self->model->thick_shell3.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell4");
+    self->model->thick_shell4.dispersion->accept_as_destination(visitor, self->model->thick_shell4.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell5");
+    self->model->thick_shell5.dispersion->accept_as_destination(visitor, self->model->thick_shell5.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell6");
+    self->model->thick_shell6.dispersion->accept_as_destination(visitor, self->model->thick_shell6.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell7");
+    self->model->thick_shell7.dispersion->accept_as_destination(visitor, self->model->thick_shell7.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell8");
+    self->model->thick_shell8.dispersion->accept_as_destination(visitor, self->model->thick_shell8.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell9");
+    self->model->thick_shell9.dispersion->accept_as_destination(visitor, self->model->thick_shell9.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell10");
+    self->model->thick_shell10.dispersion->accept_as_destination(visitor, self->model->thick_shell10.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(COnionModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell4") );
+    self->model->thick_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell5") );
+    self->model->thick_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell9") );
+    self->model->thick_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell7") );
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->A_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell10") );
+    self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") );
+    self->model->func_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell4") );
+    self->model->func_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell5") );
+    self->model->func_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell6") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->func_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell1") );
+    self->model->thick_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell10") );
+    self->model->func_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell3") );
+    self->model->func_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell8") );
+    self->model->func_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell9") );
+    self->model->sld_in_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell5") );
+    self->model->func_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell10") );
+    self->model->sld_in_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell4") );
+    self->model->sld_in_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell7") );
+    self->model->sld_out_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell9") );
+    self->model->sld_out_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell8") );
+    self->model->thick_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell6") );
+    self->model->sld_out_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell2") );
+    self->model->sld_in_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell9") );
+    self->model->sld_in_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell8") );
+    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") );
+    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );
+    self->model->sld_out_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell1") );
+    self->model->sld_out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") );
+    self->model->sld_out_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell3") );
+    self->model->sld_in_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell6") );
+    self->model->sld_in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") );
+    self->model->sld_out_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell4") );
+    self->model->sld_in_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell3") );
+    self->model->sld_out_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell6") );
+    self->model->func_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell7") );
+    self->model->sld_out_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell7") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->n_shells = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_shells") );
+    self->model->sld_in_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell2") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->func_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell2") );
+    self->model->thick_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell8") );
+    self->model->sld_out_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell10") );
+    self->model->sld_in_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell10") );
+    self->model->A_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell8") );
+    self->model->A_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell9") );
+    self->model->A_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell6") );
+    self->model->A_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell7") );
+    self->model->A_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell4") );
+    self->model->A_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell5") );
+    self->model->A_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell2") );
+    self->model->A_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell3") );
+    self->model->A_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell1") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1");
+    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell2");
+    self->model->thick_shell2.dispersion->accept_as_destination(visitor, self->model->thick_shell2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell3");
+    self->model->thick_shell3.dispersion->accept_as_destination(visitor, self->model->thick_shell3.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell4");
+    self->model->thick_shell4.dispersion->accept_as_destination(visitor, self->model->thick_shell4.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell5");
+    self->model->thick_shell5.dispersion->accept_as_destination(visitor, self->model->thick_shell5.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell6");
+    self->model->thick_shell6.dispersion->accept_as_destination(visitor, self->model->thick_shell6.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell7");
+    self->model->thick_shell7.dispersion->accept_as_destination(visitor, self->model->thick_shell7.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell8");
+    self->model->thick_shell8.dispersion->accept_as_destination(visitor, self->model->thick_shell8.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell9");
+    self->model->thick_shell9.dispersion->accept_as_destination(visitor, self->model->thick_shell9.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell10");
+    self->model->thick_shell10.dispersion->accept_as_destination(visitor, self->model->thick_shell10.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(COnionModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell4") );
+    self->model->thick_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell5") );
+    self->model->thick_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell9") );
+    self->model->thick_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell7") );
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->A_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell10") );
+    self->model->thick_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell1") );
+    self->model->func_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell4") );
+    self->model->func_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell5") );
+    self->model->func_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell6") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->func_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell1") );
+    self->model->thick_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell10") );
+    self->model->func_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell3") );
+    self->model->func_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell8") );
+    self->model->func_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell9") );
+    self->model->sld_in_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell5") );
+    self->model->func_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell10") );
+    self->model->sld_in_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell4") );
+    self->model->sld_in_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell7") );
+    self->model->sld_out_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell9") );
+    self->model->sld_out_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell8") );
+    self->model->thick_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell6") );
+    self->model->sld_out_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell2") );
+    self->model->sld_in_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell9") );
+    self->model->sld_in_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell8") );
+    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") );
+    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );
+    self->model->sld_out_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell1") );
+    self->model->sld_out_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell5") );
+    self->model->sld_out_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell3") );
+    self->model->sld_in_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell6") );
+    self->model->sld_in_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell1") );
+    self->model->sld_out_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell4") );
+    self->model->sld_in_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell3") );
+    self->model->sld_out_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell6") );
+    self->model->func_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell7") );
+    self->model->sld_out_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell7") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->n_shells = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_shells") );
+    self->model->sld_in_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell2") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->func_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_shell2") );
+    self->model->thick_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell8") );
+    self->model->sld_out_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_out_shell10") );
+    self->model->sld_in_shell10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_in_shell10") );
+    self->model->A_shell8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell8") );
+    self->model->A_shell9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell9") );
+    self->model->A_shell6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell6") );
+    self->model->A_shell7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell7") );
+    self->model->A_shell4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell4") );
+    self->model->A_shell5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell5") );
+    self->model->A_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell2") );
+    self->model->A_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell3") );
+    self->model->A_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "A_shell1") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1");
+    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell2");
+    self->model->thick_shell2.dispersion->accept_as_destination(visitor, self->model->thick_shell2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell3");
+    self->model->thick_shell3.dispersion->accept_as_destination(visitor, self->model->thick_shell3.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell4");
+    self->model->thick_shell4.dispersion->accept_as_destination(visitor, self->model->thick_shell4.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell5");
+    self->model->thick_shell5.dispersion->accept_as_destination(visitor, self->model->thick_shell5.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell6");
+    self->model->thick_shell6.dispersion->accept_as_destination(visitor, self->model->thick_shell6.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell7");
+    self->model->thick_shell7.dispersion->accept_as_destination(visitor, self->model->thick_shell7.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell8");
+    self->model->thick_shell8.dispersion->accept_as_destination(visitor, self->model->thick_shell8.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell9");
+    self->model->thick_shell9.dispersion->accept_as_destination(visitor, self->model->thick_shell9.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell10");
+    self->model->thick_shell10.dispersion->accept_as_destination(visitor, self->model->thick_shell10.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(COnionModelError, 
+	    	"COnionModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(COnionModelError, 
+	    		"COnionModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = COnionModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = COnionModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = COnionModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(COnionModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(COnionModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(COnionModelError,
+	    	"COnionModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "rad_core0")) {
+        self->model->rad_core0.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell1")) {
+        self->model->thick_shell1.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell2")) {
+        self->model->thick_shell2.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell3")) {
+        self->model->thick_shell3.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell4")) {
+        self->model->thick_shell4.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell5")) {
+        self->model->thick_shell5.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell6")) {
+        self->model->thick_shell6.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell7")) {
+        self->model->thick_shell7.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell8")) {
+        self->model->thick_shell8.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell9")) {
+        self->model->thick_shell9.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_shell10")) {
+        self->model->thick_shell10.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(COnionModelError,
+	    	"COnionModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef COnionModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject COnionModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "COnionModel",             /*tp_name*/
+    sizeof(COnionModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)COnionModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "COnionModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    COnionModel_methods,             /* tp_methods */
+    COnionModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)COnionModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    COnionModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCOnionModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&COnionModelType) < 0)
+        return;
+
+    Py_INCREF(&COnionModelType);
+    PyModule_AddObject(module, "COnionModel", (PyObject *)&COnionModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "COnionModel.error";
+    COnionModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "COnionModelError", COnionModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CParallelepipedModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CParallelepipedModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CParallelepipedModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,741 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CParallelepipedModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\parallelepiped.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "parallelepiped.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CParallelepipedModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    ParallelepipedModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CParallelepipedModel;
+
+
+static void
+CParallelepipedModel_dealloc(CParallelepipedModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CParallelepipedModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CParallelepipedModel *self;
+    
+    self = (CParallelepipedModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CParallelepipedModel_init(CParallelepipedModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new ParallelepipedModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"Up_frac_i",Py_BuildValue("d",0.500000000000));
+        PyDict_SetItemString(self->params,"short_a",Py_BuildValue("d",35.000000000000));
+        PyDict_SetItemString(self->params,"short_b",Py_BuildValue("d",75.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"long_c",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"sldPipe",Py_BuildValue("d",0.000006300000));
+        PyDict_SetItemString(self->params,"Up_theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_theta_pipe",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"parallel_psi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"parallel_phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"parallel_theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"Up_frac_f",Py_BuildValue("d",0.500000000000));
+        PyDict_SetItemString(self->params,"M_phi_pipe",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_theta_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_pipe",Py_BuildValue("d",0.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->short_a.dispersion->accept_as_source(visitor, self->model->short_a.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "short_a", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->short_b.dispersion->accept_as_source(visitor, self->model->short_b.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "short_b", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->long_c.dispersion->accept_as_source(visitor, self->model->long_c.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "long_c", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->parallel_phi.dispersion->accept_as_source(visitor, self->model->parallel_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "parallel_phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->parallel_psi.dispersion->accept_as_source(visitor, self->model->parallel_psi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "parallel_psi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->parallel_theta.dispersion->accept_as_source(visitor, self->model->parallel_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "parallel_theta", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CParallelepipedModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CParallelepipedModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CParallelepipedModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CParallelepipedModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CParallelepipedModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(ParallelepipedModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( ParallelepipedModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CParallelepipedModelError, 
+                   "CParallelepipedModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CParallelepipedModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->short_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_a") );
+    self->model->short_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_b") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->long_c = PyFloat_AsDouble( PyDict_GetItemString(self->params, "long_c") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->M_theta_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_pipe") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
+    self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->parallel_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->M_phi_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_pipe") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M0_sld_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_pipe") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_a");
+    self->model->short_a.dispersion->accept_as_destination(visitor, self->model->short_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_b");
+    self->model->short_b.dispersion->accept_as_destination(visitor, self->model->short_b.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "long_c");
+    self->model->long_c.dispersion->accept_as_destination(visitor, self->model->long_c.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
+    self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
+    self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CParallelepipedModelError, 
+	    	"CParallelepipedModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CParallelepipedModelError, 
+                   "CParallelepipedModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CParallelepipedModelError, 
+	    		"CParallelepipedModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CParallelepipedModelError, 
+                   "CParallelepipedModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CParallelepipedModelError, 
+                   "CParallelepipedModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CParallelepipedModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->short_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_a") );
+    self->model->short_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_b") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->long_c = PyFloat_AsDouble( PyDict_GetItemString(self->params, "long_c") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->M_theta_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_pipe") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
+    self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->parallel_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->M_phi_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_pipe") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M0_sld_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_pipe") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_a");
+    self->model->short_a.dispersion->accept_as_destination(visitor, self->model->short_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_b");
+    self->model->short_b.dispersion->accept_as_destination(visitor, self->model->short_b.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "long_c");
+    self->model->long_c.dispersion->accept_as_destination(visitor, self->model->long_c.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
+    self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
+    self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CParallelepipedModelError, 
+	    	"CParallelepipedModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CParallelepipedModelError, 
+	    		"CParallelepipedModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CParallelepipedModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CParallelepipedModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CParallelepipedModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CParallelepipedModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->short_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_a") );
+    self->model->short_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_b") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->long_c = PyFloat_AsDouble( PyDict_GetItemString(self->params, "long_c") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->M_theta_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_pipe") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
+    self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->parallel_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->M_phi_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_pipe") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M0_sld_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_pipe") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_a");
+    self->model->short_a.dispersion->accept_as_destination(visitor, self->model->short_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_b");
+    self->model->short_b.dispersion->accept_as_destination(visitor, self->model->short_b.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "long_c");
+    self->model->long_c.dispersion->accept_as_destination(visitor, self->model->long_c.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
+    self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
+    self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CParallelepipedModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->short_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_a") );
+    self->model->short_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_b") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->long_c = PyFloat_AsDouble( PyDict_GetItemString(self->params, "long_c") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->M_theta_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_pipe") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
+    self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->parallel_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->M_phi_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_pipe") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M0_sld_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_pipe") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_a");
+    self->model->short_a.dispersion->accept_as_destination(visitor, self->model->short_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_b");
+    self->model->short_b.dispersion->accept_as_destination(visitor, self->model->short_b.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "long_c");
+    self->model->long_c.dispersion->accept_as_destination(visitor, self->model->long_c.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
+    self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
+    self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CParallelepipedModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->short_a = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_a") );
+    self->model->short_b = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_b") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->long_c = PyFloat_AsDouble( PyDict_GetItemString(self->params, "long_c") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->M_theta_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_pipe") );
+    self->model->parallel_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_psi") );
+    self->model->parallel_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_phi") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->parallel_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "parallel_theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->M_phi_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_pipe") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M0_sld_pipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_pipe") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_a");
+    self->model->short_a.dispersion->accept_as_destination(visitor, self->model->short_a.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_b");
+    self->model->short_b.dispersion->accept_as_destination(visitor, self->model->short_b.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "long_c");
+    self->model->long_c.dispersion->accept_as_destination(visitor, self->model->long_c.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_phi");
+    self->model->parallel_phi.dispersion->accept_as_destination(visitor, self->model->parallel_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_psi");
+    self->model->parallel_psi.dispersion->accept_as_destination(visitor, self->model->parallel_psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "parallel_theta");
+    self->model->parallel_theta.dispersion->accept_as_destination(visitor, self->model->parallel_theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CParallelepipedModelError, 
+	    	"CParallelepipedModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CParallelepipedModelError, 
+	    		"CParallelepipedModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CParallelepipedModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CParallelepipedModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CParallelepipedModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CParallelepipedModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CParallelepipedModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CParallelepipedModelError,
+	    	"CParallelepipedModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "short_a")) {
+        self->model->short_a.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "short_b")) {
+        self->model->short_b.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "long_c")) {
+        self->model->long_c.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "parallel_phi")) {
+        self->model->parallel_phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "parallel_psi")) {
+        self->model->parallel_psi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "parallel_theta")) {
+        self->model->parallel_theta.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CParallelepipedModelError,
+	    	"CParallelepipedModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CParallelepipedModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CParallelepipedModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CParallelepipedModel",             /*tp_name*/
+    sizeof(CParallelepipedModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CParallelepipedModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CParallelepipedModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CParallelepipedModel_methods,             /* tp_methods */
+    CParallelepipedModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CParallelepipedModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CParallelepipedModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCParallelepipedModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CParallelepipedModelType) < 0)
+        return;
+
+    Py_INCREF(&CParallelepipedModelType);
+    PyModule_AddObject(module, "CParallelepipedModel", (PyObject *)&CParallelepipedModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CParallelepipedModel.error";
+    CParallelepipedModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CParallelepipedModelError", CParallelepipedModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CPearlNecklaceModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CPearlNecklaceModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CPearlNecklaceModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,621 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CPearlNecklaceModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\pearlnecklace.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "pearlnecklace.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CPearlNecklaceModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    PearlNecklaceModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CPearlNecklaceModel;
+
+
+static void
+CPearlNecklaceModel_dealloc(CPearlNecklaceModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CPearlNecklaceModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CPearlNecklaceModel *self;
+    
+    self = (CPearlNecklaceModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CPearlNecklaceModel_init(CPearlNecklaceModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new PearlNecklaceModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"num_pearls",Py_BuildValue("d",3.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_string",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"sld_string",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"edge_separation",Py_BuildValue("d",350.000000000000));
+        PyDict_SetItemString(self->params,"sld_pearl",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",80.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000006300000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->edge_separation.dispersion->accept_as_source(visitor, self->model->edge_separation.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "edge_separation", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CPearlNecklaceModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CPearlNecklaceModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CPearlNecklaceModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CPearlNecklaceModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CPearlNecklaceModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(PearlNecklaceModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( PearlNecklaceModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CPearlNecklaceModelError, 
+                   "CPearlNecklaceModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CPearlNecklaceModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->num_pearls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "num_pearls") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_string = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_string") );
+    self->model->sld_string = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_string") );
+    self->model->edge_separation = PyFloat_AsDouble( PyDict_GetItemString(self->params, "edge_separation") );
+    self->model->sld_pearl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pearl") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "edge_separation");
+    self->model->edge_separation.dispersion->accept_as_destination(visitor, self->model->edge_separation.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CPearlNecklaceModelError, 
+	    	"CPearlNecklaceModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CPearlNecklaceModelError, 
+                   "CPearlNecklaceModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CPearlNecklaceModelError, 
+	    		"CPearlNecklaceModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CPearlNecklaceModelError, 
+                   "CPearlNecklaceModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CPearlNecklaceModelError, 
+                   "CPearlNecklaceModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CPearlNecklaceModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->num_pearls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "num_pearls") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_string = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_string") );
+    self->model->sld_string = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_string") );
+    self->model->edge_separation = PyFloat_AsDouble( PyDict_GetItemString(self->params, "edge_separation") );
+    self->model->sld_pearl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pearl") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "edge_separation");
+    self->model->edge_separation.dispersion->accept_as_destination(visitor, self->model->edge_separation.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CPearlNecklaceModelError, 
+	    	"CPearlNecklaceModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CPearlNecklaceModelError, 
+	    		"CPearlNecklaceModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CPearlNecklaceModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CPearlNecklaceModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CPearlNecklaceModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CPearlNecklaceModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->num_pearls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "num_pearls") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_string = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_string") );
+    self->model->sld_string = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_string") );
+    self->model->edge_separation = PyFloat_AsDouble( PyDict_GetItemString(self->params, "edge_separation") );
+    self->model->sld_pearl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pearl") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "edge_separation");
+    self->model->edge_separation.dispersion->accept_as_destination(visitor, self->model->edge_separation.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CPearlNecklaceModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->num_pearls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "num_pearls") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_string = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_string") );
+    self->model->sld_string = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_string") );
+    self->model->edge_separation = PyFloat_AsDouble( PyDict_GetItemString(self->params, "edge_separation") );
+    self->model->sld_pearl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pearl") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "edge_separation");
+    self->model->edge_separation.dispersion->accept_as_destination(visitor, self->model->edge_separation.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CPearlNecklaceModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->num_pearls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "num_pearls") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_string = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_string") );
+    self->model->sld_string = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_string") );
+    self->model->edge_separation = PyFloat_AsDouble( PyDict_GetItemString(self->params, "edge_separation") );
+    self->model->sld_pearl = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pearl") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "edge_separation");
+    self->model->edge_separation.dispersion->accept_as_destination(visitor, self->model->edge_separation.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CPearlNecklaceModelError, 
+	    	"CPearlNecklaceModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CPearlNecklaceModelError, 
+	    		"CPearlNecklaceModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CPearlNecklaceModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CPearlNecklaceModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CPearlNecklaceModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CPearlNecklaceModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CPearlNecklaceModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CPearlNecklaceModelError,
+	    	"CPearlNecklaceModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "edge_separation")) {
+        self->model->edge_separation.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CPearlNecklaceModelError,
+	    	"CPearlNecklaceModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CPearlNecklaceModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CPearlNecklaceModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CPearlNecklaceModel",             /*tp_name*/
+    sizeof(CPearlNecklaceModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CPearlNecklaceModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CPearlNecklaceModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CPearlNecklaceModel_methods,             /* tp_methods */
+    CPearlNecklaceModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CPearlNecklaceModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CPearlNecklaceModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCPearlNecklaceModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CPearlNecklaceModelType) < 0)
+        return;
+
+    Py_INCREF(&CPearlNecklaceModelType);
+    PyModule_AddObject(module, "CPearlNecklaceModel", (PyObject *)&CPearlNecklaceModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CPearlNecklaceModel.error";
+    CPearlNecklaceModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CPearlNecklaceModelError", CPearlNecklaceModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CPoly_GaussCoil.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CPoly_GaussCoil.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CPoly_GaussCoil.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,576 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CPoly_GaussCoil
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\polygausscoil.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "polygausscoil.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CPoly_GaussCoilError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    Poly_GaussCoil * model;
+    /// Log for unit testing
+    PyObject * log;
+} CPoly_GaussCoil;
+
+
+static void
+CPoly_GaussCoil_dealloc(CPoly_GaussCoil* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CPoly_GaussCoil_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CPoly_GaussCoil *self;
+    
+    self = (CPoly_GaussCoil *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CPoly_GaussCoil_init(CPoly_GaussCoil *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new Poly_GaussCoil();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"poly_m",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"rg",Py_BuildValue("d",60.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->rg.dispersion->accept_as_source(visitor, self->model->rg.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "rg", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CPoly_GaussCoil_members[] = {
+    {name_params, T_OBJECT, offsetof(CPoly_GaussCoil, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CPoly_GaussCoil, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CPoly_GaussCoil, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CPoly_GaussCoil_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(Poly_GaussCoil* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( Poly_GaussCoil* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CPoly_GaussCoilError, 
+                   "CPoly_GaussCoil.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CPoly_GaussCoil *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->poly_m = PyFloat_AsDouble( PyDict_GetItemString(self->params, "poly_m") );
+    self->model->rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rg");
+    self->model->rg.dispersion->accept_as_destination(visitor, self->model->rg.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CPoly_GaussCoilError, 
+	    	"CPoly_GaussCoil.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CPoly_GaussCoilError, 
+                   "CPoly_GaussCoil.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CPoly_GaussCoilError, 
+	    		"CPoly_GaussCoil.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CPoly_GaussCoilError, 
+                   "CPoly_GaussCoil.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CPoly_GaussCoilError, 
+                   "CPoly_GaussCoil.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CPoly_GaussCoil *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->poly_m = PyFloat_AsDouble( PyDict_GetItemString(self->params, "poly_m") );
+    self->model->rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rg");
+    self->model->rg.dispersion->accept_as_destination(visitor, self->model->rg.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CPoly_GaussCoilError, 
+	    	"CPoly_GaussCoil.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CPoly_GaussCoilError, 
+	    		"CPoly_GaussCoil.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CPoly_GaussCoil_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CPoly_GaussCoil_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CPoly_GaussCoil_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CPoly_GaussCoil *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->poly_m = PyFloat_AsDouble( PyDict_GetItemString(self->params, "poly_m") );
+    self->model->rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rg");
+    self->model->rg.dispersion->accept_as_destination(visitor, self->model->rg.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CPoly_GaussCoil *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->poly_m = PyFloat_AsDouble( PyDict_GetItemString(self->params, "poly_m") );
+    self->model->rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rg");
+    self->model->rg.dispersion->accept_as_destination(visitor, self->model->rg.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CPoly_GaussCoil *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->poly_m = PyFloat_AsDouble( PyDict_GetItemString(self->params, "poly_m") );
+    self->model->rg = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rg") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rg");
+    self->model->rg.dispersion->accept_as_destination(visitor, self->model->rg.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CPoly_GaussCoilError, 
+	    	"CPoly_GaussCoil.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CPoly_GaussCoilError, 
+	    		"CPoly_GaussCoil.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CPoly_GaussCoil_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CPoly_GaussCoil_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CPoly_GaussCoil_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CPoly_GaussCoil *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CPoly_GaussCoil *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CPoly_GaussCoilError,
+	    	"CPoly_GaussCoil.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "rg")) {
+        self->model->rg.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CPoly_GaussCoilError,
+	    	"CPoly_GaussCoil.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CPoly_GaussCoil_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CPoly_GaussCoilType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CPoly_GaussCoil",             /*tp_name*/
+    sizeof(CPoly_GaussCoil),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CPoly_GaussCoil_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CPoly_GaussCoil objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CPoly_GaussCoil_methods,             /* tp_methods */
+    CPoly_GaussCoil_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CPoly_GaussCoil_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CPoly_GaussCoil_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCPoly_GaussCoil(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CPoly_GaussCoilType) < 0)
+        return;
+
+    Py_INCREF(&CPoly_GaussCoilType);
+    PyModule_AddObject(module, "CPoly_GaussCoil", (PyObject *)&CPoly_GaussCoilType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CPoly_GaussCoil.error";
+    CPoly_GaussCoilError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CPoly_GaussCoilError", CPoly_GaussCoilError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CPringlesModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CPringlesModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CPringlesModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,645 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CPringlesModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\pringles.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "pringles.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CPringlesModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    PringlesModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CPringlesModel;
+
+
+static void
+CPringlesModel_dealloc(CPringlesModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CPringlesModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CPringlesModel *self;
+    
+    self = (CPringlesModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CPringlesModel_init(CPringlesModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new PringlesModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006350000));
+        PyDict_SetItemString(self->params,"thickness",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"beta",Py_BuildValue("d",0.020000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",60.000000000000));
+        PyDict_SetItemString(self->params,"sld_pringle",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"alpha",Py_BuildValue("d",0.001000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thickness.dispersion->accept_as_source(visitor, self->model->thickness.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thickness", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->alpha.dispersion->accept_as_source(visitor, self->model->alpha.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "alpha", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->beta.dispersion->accept_as_source(visitor, self->model->beta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "beta", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CPringlesModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CPringlesModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CPringlesModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CPringlesModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CPringlesModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(PringlesModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( PringlesModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CPringlesModelError, 
+                   "CPringlesModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CPringlesModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->beta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "beta") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->sld_pringle = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pringle") );
+    self->model->alpha = PyFloat_AsDouble( PyDict_GetItemString(self->params, "alpha") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "alpha");
+    self->model->alpha.dispersion->accept_as_destination(visitor, self->model->alpha.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "beta");
+    self->model->beta.dispersion->accept_as_destination(visitor, self->model->beta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CPringlesModelError, 
+	    	"CPringlesModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CPringlesModelError, 
+                   "CPringlesModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CPringlesModelError, 
+	    		"CPringlesModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CPringlesModelError, 
+                   "CPringlesModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CPringlesModelError, 
+                   "CPringlesModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CPringlesModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->beta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "beta") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->sld_pringle = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pringle") );
+    self->model->alpha = PyFloat_AsDouble( PyDict_GetItemString(self->params, "alpha") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "alpha");
+    self->model->alpha.dispersion->accept_as_destination(visitor, self->model->alpha.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "beta");
+    self->model->beta.dispersion->accept_as_destination(visitor, self->model->beta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CPringlesModelError, 
+	    	"CPringlesModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CPringlesModelError, 
+	    		"CPringlesModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CPringlesModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CPringlesModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CPringlesModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CPringlesModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->beta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "beta") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->sld_pringle = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pringle") );
+    self->model->alpha = PyFloat_AsDouble( PyDict_GetItemString(self->params, "alpha") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "alpha");
+    self->model->alpha.dispersion->accept_as_destination(visitor, self->model->alpha.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "beta");
+    self->model->beta.dispersion->accept_as_destination(visitor, self->model->beta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CPringlesModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->beta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "beta") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->sld_pringle = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pringle") );
+    self->model->alpha = PyFloat_AsDouble( PyDict_GetItemString(self->params, "alpha") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "alpha");
+    self->model->alpha.dispersion->accept_as_destination(visitor, self->model->alpha.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "beta");
+    self->model->beta.dispersion->accept_as_destination(visitor, self->model->beta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CPringlesModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->beta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "beta") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->sld_pringle = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_pringle") );
+    self->model->alpha = PyFloat_AsDouble( PyDict_GetItemString(self->params, "alpha") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "alpha");
+    self->model->alpha.dispersion->accept_as_destination(visitor, self->model->alpha.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "beta");
+    self->model->beta.dispersion->accept_as_destination(visitor, self->model->beta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CPringlesModelError, 
+	    	"CPringlesModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CPringlesModelError, 
+	    		"CPringlesModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CPringlesModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CPringlesModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CPringlesModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CPringlesModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CPringlesModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CPringlesModelError,
+	    	"CPringlesModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thickness")) {
+        self->model->thickness.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "alpha")) {
+        self->model->alpha.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "beta")) {
+        self->model->beta.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CPringlesModelError,
+	    	"CPringlesModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CPringlesModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CPringlesModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CPringlesModel",             /*tp_name*/
+    sizeof(CPringlesModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CPringlesModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CPringlesModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CPringlesModel_methods,             /* tp_methods */
+    CPringlesModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CPringlesModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CPringlesModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCPringlesModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CPringlesModelType) < 0)
+        return;
+
+    Py_INCREF(&CPringlesModelType);
+    PyModule_AddObject(module, "CPringlesModel", (PyObject *)&CPringlesModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CPringlesModel.error";
+    CPringlesModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CPringlesModelError", CPringlesModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CRPAModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CRPAModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CRPAModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,726 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CRPAModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\rpa.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "rpa.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CRPAModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    RPAModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CRPAModel;
+
+
+static void
+CRPAModel_dealloc(CRPAModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CRPAModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CRPAModel *self;
+    
+    self = (CRPAModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CRPAModel_init(CRPAModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new RPAModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"va",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"vb",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"vc",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"Lb",Py_BuildValue("d",0.000000000001));
+        PyDict_SetItemString(self->params,"Lc",Py_BuildValue("d",0.000000000001));
+        PyDict_SetItemString(self->params,"La",Py_BuildValue("d",0.000000000001));
+        PyDict_SetItemString(self->params,"Na",Py_BuildValue("d",1000.000000000000));
+        PyDict_SetItemString(self->params,"Nb",Py_BuildValue("d",1000.000000000000));
+        PyDict_SetItemString(self->params,"Nc",Py_BuildValue("d",1000.000000000000));
+        PyDict_SetItemString(self->params,"Nd",Py_BuildValue("d",1000.000000000000));
+        PyDict_SetItemString(self->params,"Ld",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"Kcd",Py_BuildValue("d",-0.000400000000));
+        PyDict_SetItemString(self->params,"vd",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"Phib",Py_BuildValue("d",0.250000000000));
+        PyDict_SetItemString(self->params,"Kac",Py_BuildValue("d",-0.000400000000));
+        PyDict_SetItemString(self->params,"Kab",Py_BuildValue("d",-0.000400000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"bb",Py_BuildValue("d",5.000000000000));
+        PyDict_SetItemString(self->params,"Kad",Py_BuildValue("d",-0.000400000000));
+        PyDict_SetItemString(self->params,"bd",Py_BuildValue("d",5.000000000000));
+        PyDict_SetItemString(self->params,"Phid",Py_BuildValue("d",0.250000000000));
+        PyDict_SetItemString(self->params,"Phic",Py_BuildValue("d",0.250000000000));
+        PyDict_SetItemString(self->params,"ba",Py_BuildValue("d",5.000000000000));
+        PyDict_SetItemString(self->params,"Phia",Py_BuildValue("d",0.250000000000));
+        PyDict_SetItemString(self->params,"bc",Py_BuildValue("d",5.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"Kbc",Py_BuildValue("d",-0.000400000000));
+        PyDict_SetItemString(self->params,"Kbd",Py_BuildValue("d",-0.000400000000));
+        PyDict_SetItemString(self->params,"lcase_n",Py_BuildValue("d",0.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->background.dispersion->accept_as_source(visitor, self->model->background.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "background", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CRPAModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CRPAModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CRPAModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CRPAModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CRPAModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(RPAModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( RPAModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CRPAModelError, 
+                   "CRPAModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CRPAModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->va = PyFloat_AsDouble( PyDict_GetItemString(self->params, "va") );
+    self->model->vb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vb") );
+    self->model->vc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vc") );
+    self->model->Lb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Lb") );
+    self->model->Lc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Lc") );
+    self->model->La = PyFloat_AsDouble( PyDict_GetItemString(self->params, "La") );
+    self->model->Na = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Na") );
+    self->model->Nb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nb") );
+    self->model->Nc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nc") );
+    self->model->Nd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nd") );
+    self->model->Ld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Ld") );
+    self->model->Kcd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kcd") );
+    self->model->vd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vd") );
+    self->model->Phib = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phib") );
+    self->model->Kac = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kac") );
+    self->model->Kab = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kab") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->bb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bb") );
+    self->model->Kad = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kad") );
+    self->model->bd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bd") );
+    self->model->Phid = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phid") );
+    self->model->Phic = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phic") );
+    self->model->ba = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ba") );
+    self->model->Phia = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phia") );
+    self->model->bc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bc") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->Kbc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kbc") );
+    self->model->Kbd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kbd") );
+    self->model->lcase_n = PyFloat_AsDouble( PyDict_GetItemString(self->params, "lcase_n") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRPAModelError, 
+	    	"CRPAModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CRPAModelError, 
+                   "CRPAModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CRPAModelError, 
+	    		"CRPAModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CRPAModelError, 
+                   "CRPAModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CRPAModelError, 
+                   "CRPAModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CRPAModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->va = PyFloat_AsDouble( PyDict_GetItemString(self->params, "va") );
+    self->model->vb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vb") );
+    self->model->vc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vc") );
+    self->model->Lb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Lb") );
+    self->model->Lc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Lc") );
+    self->model->La = PyFloat_AsDouble( PyDict_GetItemString(self->params, "La") );
+    self->model->Na = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Na") );
+    self->model->Nb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nb") );
+    self->model->Nc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nc") );
+    self->model->Nd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nd") );
+    self->model->Ld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Ld") );
+    self->model->Kcd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kcd") );
+    self->model->vd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vd") );
+    self->model->Phib = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phib") );
+    self->model->Kac = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kac") );
+    self->model->Kab = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kab") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->bb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bb") );
+    self->model->Kad = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kad") );
+    self->model->bd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bd") );
+    self->model->Phid = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phid") );
+    self->model->Phic = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phic") );
+    self->model->ba = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ba") );
+    self->model->Phia = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phia") );
+    self->model->bc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bc") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->Kbc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kbc") );
+    self->model->Kbd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kbd") );
+    self->model->lcase_n = PyFloat_AsDouble( PyDict_GetItemString(self->params, "lcase_n") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRPAModelError, 
+	    	"CRPAModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CRPAModelError, 
+	    		"CRPAModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CRPAModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CRPAModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CRPAModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CRPAModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->va = PyFloat_AsDouble( PyDict_GetItemString(self->params, "va") );
+    self->model->vb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vb") );
+    self->model->vc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vc") );
+    self->model->Lb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Lb") );
+    self->model->Lc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Lc") );
+    self->model->La = PyFloat_AsDouble( PyDict_GetItemString(self->params, "La") );
+    self->model->Na = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Na") );
+    self->model->Nb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nb") );
+    self->model->Nc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nc") );
+    self->model->Nd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nd") );
+    self->model->Ld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Ld") );
+    self->model->Kcd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kcd") );
+    self->model->vd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vd") );
+    self->model->Phib = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phib") );
+    self->model->Kac = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kac") );
+    self->model->Kab = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kab") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->bb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bb") );
+    self->model->Kad = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kad") );
+    self->model->bd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bd") );
+    self->model->Phid = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phid") );
+    self->model->Phic = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phic") );
+    self->model->ba = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ba") );
+    self->model->Phia = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phia") );
+    self->model->bc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bc") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->Kbc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kbc") );
+    self->model->Kbd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kbd") );
+    self->model->lcase_n = PyFloat_AsDouble( PyDict_GetItemString(self->params, "lcase_n") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CRPAModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->va = PyFloat_AsDouble( PyDict_GetItemString(self->params, "va") );
+    self->model->vb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vb") );
+    self->model->vc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vc") );
+    self->model->Lb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Lb") );
+    self->model->Lc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Lc") );
+    self->model->La = PyFloat_AsDouble( PyDict_GetItemString(self->params, "La") );
+    self->model->Na = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Na") );
+    self->model->Nb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nb") );
+    self->model->Nc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nc") );
+    self->model->Nd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nd") );
+    self->model->Ld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Ld") );
+    self->model->Kcd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kcd") );
+    self->model->vd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vd") );
+    self->model->Phib = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phib") );
+    self->model->Kac = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kac") );
+    self->model->Kab = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kab") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->bb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bb") );
+    self->model->Kad = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kad") );
+    self->model->bd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bd") );
+    self->model->Phid = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phid") );
+    self->model->Phic = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phic") );
+    self->model->ba = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ba") );
+    self->model->Phia = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phia") );
+    self->model->bc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bc") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->Kbc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kbc") );
+    self->model->Kbd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kbd") );
+    self->model->lcase_n = PyFloat_AsDouble( PyDict_GetItemString(self->params, "lcase_n") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CRPAModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->va = PyFloat_AsDouble( PyDict_GetItemString(self->params, "va") );
+    self->model->vb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vb") );
+    self->model->vc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vc") );
+    self->model->Lb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Lb") );
+    self->model->Lc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Lc") );
+    self->model->La = PyFloat_AsDouble( PyDict_GetItemString(self->params, "La") );
+    self->model->Na = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Na") );
+    self->model->Nb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nb") );
+    self->model->Nc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nc") );
+    self->model->Nd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Nd") );
+    self->model->Ld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Ld") );
+    self->model->Kcd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kcd") );
+    self->model->vd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vd") );
+    self->model->Phib = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phib") );
+    self->model->Kac = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kac") );
+    self->model->Kab = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kab") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->bb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bb") );
+    self->model->Kad = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kad") );
+    self->model->bd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bd") );
+    self->model->Phid = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phid") );
+    self->model->Phic = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phic") );
+    self->model->ba = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ba") );
+    self->model->Phia = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Phia") );
+    self->model->bc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "bc") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->Kbc = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kbc") );
+    self->model->Kbd = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Kbd") );
+    self->model->lcase_n = PyFloat_AsDouble( PyDict_GetItemString(self->params, "lcase_n") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRPAModelError, 
+	    	"CRPAModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CRPAModelError, 
+	    		"CRPAModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CRPAModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CRPAModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CRPAModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CRPAModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CRPAModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CRPAModelError,
+	    	"CRPAModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "background")) {
+        self->model->background.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CRPAModelError,
+	    	"CRPAModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CRPAModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CRPAModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CRPAModel",             /*tp_name*/
+    sizeof(CRPAModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CRPAModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CRPAModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CRPAModel_methods,             /* tp_methods */
+    CRPAModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CRPAModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CRPAModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCRPAModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CRPAModelType) < 0)
+        return;
+
+    Py_INCREF(&CRPAModelType);
+    PyModule_AddObject(module, "CRPAModel", (PyObject *)&CRPAModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CRPAModel.error";
+    CRPAModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CRPAModelError", CRPAModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CRaspBerryModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CRaspBerryModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CRaspBerryModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,612 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CRaspBerryModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\raspberry.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "raspberry.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CRaspBerryModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    RaspBerryModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CRaspBerryModel;
+
+
+static void
+CRaspBerryModel_dealloc(CRaspBerryModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CRaspBerryModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CRaspBerryModel *self;
+    
+    self = (CRaspBerryModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CRaspBerryModel_init(CRaspBerryModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new RaspBerryModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"volf_Ssph",Py_BuildValue("d",0.005000000000));
+        PyDict_SetItemString(self->params,"sld_Ssph",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"radius_Ssph",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"delta_Ssph",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"radius_Lsph",Py_BuildValue("d",5000.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"surfrac_Ssph",Py_BuildValue("d",0.400000000000));
+        PyDict_SetItemString(self->params,"sld_Lsph",Py_BuildValue("d",-0.000000400000));
+        PyDict_SetItemString(self->params,"volf_Lsph",Py_BuildValue("d",0.050000000000));
+        PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000006300000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius_Lsph.dispersion->accept_as_source(visitor, self->model->radius_Lsph.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius_Lsph", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CRaspBerryModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CRaspBerryModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CRaspBerryModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CRaspBerryModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CRaspBerryModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(RaspBerryModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( RaspBerryModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CRaspBerryModelError, 
+                   "CRaspBerryModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CRaspBerryModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->volf_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_Ssph") );
+    self->model->sld_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_Ssph") );
+    self->model->radius_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_Ssph") );
+    self->model->delta_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta_Ssph") );
+    self->model->radius_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_Lsph") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->surfrac_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surfrac_Ssph") );
+    self->model->sld_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_Lsph") );
+    self->model->volf_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_Lsph") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_Lsph");
+    self->model->radius_Lsph.dispersion->accept_as_destination(visitor, self->model->radius_Lsph.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRaspBerryModelError, 
+	    	"CRaspBerryModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CRaspBerryModelError, 
+                   "CRaspBerryModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CRaspBerryModelError, 
+	    		"CRaspBerryModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CRaspBerryModelError, 
+                   "CRaspBerryModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CRaspBerryModelError, 
+                   "CRaspBerryModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CRaspBerryModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->volf_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_Ssph") );
+    self->model->sld_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_Ssph") );
+    self->model->radius_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_Ssph") );
+    self->model->delta_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta_Ssph") );
+    self->model->radius_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_Lsph") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->surfrac_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surfrac_Ssph") );
+    self->model->sld_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_Lsph") );
+    self->model->volf_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_Lsph") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_Lsph");
+    self->model->radius_Lsph.dispersion->accept_as_destination(visitor, self->model->radius_Lsph.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRaspBerryModelError, 
+	    	"CRaspBerryModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CRaspBerryModelError, 
+	    		"CRaspBerryModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CRaspBerryModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CRaspBerryModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CRaspBerryModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CRaspBerryModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->volf_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_Ssph") );
+    self->model->sld_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_Ssph") );
+    self->model->radius_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_Ssph") );
+    self->model->delta_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta_Ssph") );
+    self->model->radius_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_Lsph") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->surfrac_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surfrac_Ssph") );
+    self->model->sld_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_Lsph") );
+    self->model->volf_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_Lsph") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_Lsph");
+    self->model->radius_Lsph.dispersion->accept_as_destination(visitor, self->model->radius_Lsph.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CRaspBerryModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->volf_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_Ssph") );
+    self->model->sld_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_Ssph") );
+    self->model->radius_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_Ssph") );
+    self->model->delta_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta_Ssph") );
+    self->model->radius_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_Lsph") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->surfrac_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surfrac_Ssph") );
+    self->model->sld_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_Lsph") );
+    self->model->volf_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_Lsph") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_Lsph");
+    self->model->radius_Lsph.dispersion->accept_as_destination(visitor, self->model->radius_Lsph.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CRaspBerryModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->volf_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_Ssph") );
+    self->model->sld_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_Ssph") );
+    self->model->radius_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_Ssph") );
+    self->model->delta_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta_Ssph") );
+    self->model->radius_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius_Lsph") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->surfrac_Ssph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surfrac_Ssph") );
+    self->model->sld_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_Lsph") );
+    self->model->volf_Lsph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volf_Lsph") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius_Lsph");
+    self->model->radius_Lsph.dispersion->accept_as_destination(visitor, self->model->radius_Lsph.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRaspBerryModelError, 
+	    	"CRaspBerryModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CRaspBerryModelError, 
+	    		"CRaspBerryModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CRaspBerryModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CRaspBerryModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CRaspBerryModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CRaspBerryModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CRaspBerryModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CRaspBerryModelError,
+	    	"CRaspBerryModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius_Lsph")) {
+        self->model->radius_Lsph.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CRaspBerryModelError,
+	    	"CRaspBerryModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CRaspBerryModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CRaspBerryModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CRaspBerryModel",             /*tp_name*/
+    sizeof(CRaspBerryModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CRaspBerryModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CRaspBerryModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CRaspBerryModel_methods,             /* tp_methods */
+    CRaspBerryModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CRaspBerryModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CRaspBerryModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCRaspBerryModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CRaspBerryModelType) < 0)
+        return;
+
+    Py_INCREF(&CRaspBerryModelType);
+    PyModule_AddObject(module, "CRaspBerryModel", (PyObject *)&CRaspBerryModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CRaspBerryModel.error";
+    CRaspBerryModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CRaspBerryModelError", CRaspBerryModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CRectangularHollowPrismInfThinWallsModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CRectangularHollowPrismInfThinWallsModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CRectangularHollowPrismInfThinWallsModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,624 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CRectangularHollowPrismInfThinWallsModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\RectangularHollowPrismInfThinWalls.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "RectangularHollowPrismInfThinWalls.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CRectangularHollowPrismInfThinWallsModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    RectangularHollowPrismInfThinWallsModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CRectangularHollowPrismInfThinWallsModel;
+
+
+static void
+CRectangularHollowPrismInfThinWallsModel_dealloc(CRectangularHollowPrismInfThinWallsModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CRectangularHollowPrismInfThinWallsModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CRectangularHollowPrismInfThinWallsModel *self;
+    
+    self = (CRectangularHollowPrismInfThinWallsModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CRectangularHollowPrismInfThinWallsModel_init(CRectangularHollowPrismInfThinWallsModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new RectangularHollowPrismInfThinWallsModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sldPipe",Py_BuildValue("d",0.000006300000));
+        PyDict_SetItemString(self->params,"b2a_ratio",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"c2a_ratio",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"short_side",Py_BuildValue("d",35.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->short_side.dispersion->accept_as_source(visitor, self->model->short_side.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "short_side", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->b2a_ratio.dispersion->accept_as_source(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "b2a_ratio", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->c2a_ratio.dispersion->accept_as_source(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "c2a_ratio", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CRectangularHollowPrismInfThinWallsModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CRectangularHollowPrismInfThinWallsModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CRectangularHollowPrismInfThinWallsModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CRectangularHollowPrismInfThinWallsModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CRectangularHollowPrismInfThinWallsModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(RectangularHollowPrismInfThinWallsModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( RectangularHollowPrismInfThinWallsModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CRectangularHollowPrismInfThinWallsModelError, 
+                   "CRectangularHollowPrismInfThinWallsModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CRectangularHollowPrismInfThinWallsModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRectangularHollowPrismInfThinWallsModelError, 
+	    	"CRectangularHollowPrismInfThinWallsModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CRectangularHollowPrismInfThinWallsModelError, 
+                   "CRectangularHollowPrismInfThinWallsModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CRectangularHollowPrismInfThinWallsModelError, 
+	    		"CRectangularHollowPrismInfThinWallsModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CRectangularHollowPrismInfThinWallsModelError, 
+                   "CRectangularHollowPrismInfThinWallsModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CRectangularHollowPrismInfThinWallsModelError, 
+                   "CRectangularHollowPrismInfThinWallsModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CRectangularHollowPrismInfThinWallsModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRectangularHollowPrismInfThinWallsModelError, 
+	    	"CRectangularHollowPrismInfThinWallsModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CRectangularHollowPrismInfThinWallsModelError, 
+	    		"CRectangularHollowPrismInfThinWallsModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CRectangularHollowPrismInfThinWallsModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CRectangularHollowPrismInfThinWallsModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CRectangularHollowPrismInfThinWallsModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CRectangularHollowPrismInfThinWallsModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CRectangularHollowPrismInfThinWallsModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CRectangularHollowPrismInfThinWallsModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRectangularHollowPrismInfThinWallsModelError, 
+	    	"CRectangularHollowPrismInfThinWallsModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CRectangularHollowPrismInfThinWallsModelError, 
+	    		"CRectangularHollowPrismInfThinWallsModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CRectangularHollowPrismInfThinWallsModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CRectangularHollowPrismInfThinWallsModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CRectangularHollowPrismInfThinWallsModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CRectangularHollowPrismInfThinWallsModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CRectangularHollowPrismInfThinWallsModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CRectangularHollowPrismInfThinWallsModelError,
+	    	"CRectangularHollowPrismInfThinWallsModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "short_side")) {
+        self->model->short_side.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "b2a_ratio")) {
+        self->model->b2a_ratio.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "c2a_ratio")) {
+        self->model->c2a_ratio.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CRectangularHollowPrismInfThinWallsModelError,
+	    	"CRectangularHollowPrismInfThinWallsModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CRectangularHollowPrismInfThinWallsModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CRectangularHollowPrismInfThinWallsModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CRectangularHollowPrismInfThinWallsModel",             /*tp_name*/
+    sizeof(CRectangularHollowPrismInfThinWallsModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CRectangularHollowPrismInfThinWallsModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CRectangularHollowPrismInfThinWallsModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CRectangularHollowPrismInfThinWallsModel_methods,             /* tp_methods */
+    CRectangularHollowPrismInfThinWallsModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CRectangularHollowPrismInfThinWallsModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CRectangularHollowPrismInfThinWallsModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCRectangularHollowPrismInfThinWallsModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CRectangularHollowPrismInfThinWallsModelType) < 0)
+        return;
+
+    Py_INCREF(&CRectangularHollowPrismInfThinWallsModelType);
+    PyModule_AddObject(module, "CRectangularHollowPrismInfThinWallsModel", (PyObject *)&CRectangularHollowPrismInfThinWallsModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CRectangularHollowPrismInfThinWallsModel.error";
+    CRectangularHollowPrismInfThinWallsModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CRectangularHollowPrismInfThinWallsModelError", CRectangularHollowPrismInfThinWallsModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CRectangularHollowPrismModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CRectangularHollowPrismModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CRectangularHollowPrismModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,645 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CRectangularHollowPrismModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\RectangularHollowPrism.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "RectangularHollowPrism.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CRectangularHollowPrismModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    RectangularHollowPrismModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CRectangularHollowPrismModel;
+
+
+static void
+CRectangularHollowPrismModel_dealloc(CRectangularHollowPrismModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CRectangularHollowPrismModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CRectangularHollowPrismModel *self;
+    
+    self = (CRectangularHollowPrismModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CRectangularHollowPrismModel_init(CRectangularHollowPrismModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new RectangularHollowPrismModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sldPipe",Py_BuildValue("d",0.000006300000));
+        PyDict_SetItemString(self->params,"thickness",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"b2a_ratio",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"c2a_ratio",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"short_side",Py_BuildValue("d",35.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->short_side.dispersion->accept_as_source(visitor, self->model->short_side.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "short_side", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->b2a_ratio.dispersion->accept_as_source(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "b2a_ratio", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->c2a_ratio.dispersion->accept_as_source(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "c2a_ratio", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thickness.dispersion->accept_as_source(visitor, self->model->thickness.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thickness", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CRectangularHollowPrismModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CRectangularHollowPrismModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CRectangularHollowPrismModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CRectangularHollowPrismModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CRectangularHollowPrismModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(RectangularHollowPrismModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( RectangularHollowPrismModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CRectangularHollowPrismModelError, 
+                   "CRectangularHollowPrismModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CRectangularHollowPrismModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRectangularHollowPrismModelError, 
+	    	"CRectangularHollowPrismModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CRectangularHollowPrismModelError, 
+                   "CRectangularHollowPrismModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CRectangularHollowPrismModelError, 
+	    		"CRectangularHollowPrismModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CRectangularHollowPrismModelError, 
+                   "CRectangularHollowPrismModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CRectangularHollowPrismModelError, 
+                   "CRectangularHollowPrismModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CRectangularHollowPrismModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRectangularHollowPrismModelError, 
+	    	"CRectangularHollowPrismModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CRectangularHollowPrismModelError, 
+	    		"CRectangularHollowPrismModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CRectangularHollowPrismModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CRectangularHollowPrismModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CRectangularHollowPrismModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CRectangularHollowPrismModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CRectangularHollowPrismModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CRectangularHollowPrismModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRectangularHollowPrismModelError, 
+	    	"CRectangularHollowPrismModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CRectangularHollowPrismModelError, 
+	    		"CRectangularHollowPrismModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CRectangularHollowPrismModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CRectangularHollowPrismModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CRectangularHollowPrismModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CRectangularHollowPrismModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CRectangularHollowPrismModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CRectangularHollowPrismModelError,
+	    	"CRectangularHollowPrismModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "short_side")) {
+        self->model->short_side.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "b2a_ratio")) {
+        self->model->b2a_ratio.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "c2a_ratio")) {
+        self->model->c2a_ratio.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thickness")) {
+        self->model->thickness.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CRectangularHollowPrismModelError,
+	    	"CRectangularHollowPrismModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CRectangularHollowPrismModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CRectangularHollowPrismModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CRectangularHollowPrismModel",             /*tp_name*/
+    sizeof(CRectangularHollowPrismModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CRectangularHollowPrismModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CRectangularHollowPrismModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CRectangularHollowPrismModel_methods,             /* tp_methods */
+    CRectangularHollowPrismModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CRectangularHollowPrismModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CRectangularHollowPrismModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCRectangularHollowPrismModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CRectangularHollowPrismModelType) < 0)
+        return;
+
+    Py_INCREF(&CRectangularHollowPrismModelType);
+    PyModule_AddObject(module, "CRectangularHollowPrismModel", (PyObject *)&CRectangularHollowPrismModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CRectangularHollowPrismModel.error";
+    CRectangularHollowPrismModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CRectangularHollowPrismModelError", CRectangularHollowPrismModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CRectangularPrismModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CRectangularPrismModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CRectangularPrismModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,624 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CRectangularPrismModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\RectangularPrism.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "RectangularPrism.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CRectangularPrismModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    RectangularPrismModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CRectangularPrismModel;
+
+
+static void
+CRectangularPrismModel_dealloc(CRectangularPrismModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CRectangularPrismModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CRectangularPrismModel *self;
+    
+    self = (CRectangularPrismModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CRectangularPrismModel_init(CRectangularPrismModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new RectangularPrismModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sldPipe",Py_BuildValue("d",0.000006300000));
+        PyDict_SetItemString(self->params,"b2a_ratio",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"c2a_ratio",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"short_side",Py_BuildValue("d",35.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->short_side.dispersion->accept_as_source(visitor, self->model->short_side.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "short_side", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->b2a_ratio.dispersion->accept_as_source(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "b2a_ratio", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->c2a_ratio.dispersion->accept_as_source(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "c2a_ratio", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CRectangularPrismModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CRectangularPrismModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CRectangularPrismModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CRectangularPrismModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CRectangularPrismModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(RectangularPrismModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( RectangularPrismModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CRectangularPrismModelError, 
+                   "CRectangularPrismModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CRectangularPrismModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRectangularPrismModelError, 
+	    	"CRectangularPrismModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CRectangularPrismModelError, 
+                   "CRectangularPrismModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CRectangularPrismModelError, 
+	    		"CRectangularPrismModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CRectangularPrismModelError, 
+                   "CRectangularPrismModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CRectangularPrismModelError, 
+                   "CRectangularPrismModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CRectangularPrismModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRectangularPrismModelError, 
+	    	"CRectangularPrismModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CRectangularPrismModelError, 
+	    		"CRectangularPrismModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CRectangularPrismModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CRectangularPrismModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CRectangularPrismModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CRectangularPrismModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CRectangularPrismModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CRectangularPrismModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldPipe = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldPipe") );
+    self->model->b2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "b2a_ratio") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->c2a_ratio = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2a_ratio") );
+    self->model->short_side = PyFloat_AsDouble( PyDict_GetItemString(self->params, "short_side") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "short_side");
+    self->model->short_side.dispersion->accept_as_destination(visitor, self->model->short_side.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "b2a_ratio");
+    self->model->b2a_ratio.dispersion->accept_as_destination(visitor, self->model->b2a_ratio.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2a_ratio");
+    self->model->c2a_ratio.dispersion->accept_as_destination(visitor, self->model->c2a_ratio.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CRectangularPrismModelError, 
+	    	"CRectangularPrismModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CRectangularPrismModelError, 
+	    		"CRectangularPrismModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CRectangularPrismModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CRectangularPrismModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CRectangularPrismModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CRectangularPrismModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CRectangularPrismModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CRectangularPrismModelError,
+	    	"CRectangularPrismModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "short_side")) {
+        self->model->short_side.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "b2a_ratio")) {
+        self->model->b2a_ratio.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "c2a_ratio")) {
+        self->model->c2a_ratio.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CRectangularPrismModelError,
+	    	"CRectangularPrismModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CRectangularPrismModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CRectangularPrismModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CRectangularPrismModel",             /*tp_name*/
+    sizeof(CRectangularPrismModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CRectangularPrismModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CRectangularPrismModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CRectangularPrismModel_methods,             /* tp_methods */
+    CRectangularPrismModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CRectangularPrismModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CRectangularPrismModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCRectangularPrismModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CRectangularPrismModelType) < 0)
+        return;
+
+    Py_INCREF(&CRectangularPrismModelType);
+    PyModule_AddObject(module, "CRectangularPrismModel", (PyObject *)&CRectangularPrismModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CRectangularPrismModel.error";
+    CRectangularPrismModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CRectangularPrismModelError", CRectangularPrismModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CReflAdvModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CReflAdvModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CReflAdvModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,978 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CReflAdvModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\refl_adv.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "refl_adv.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CReflAdvModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    ReflAdvModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CReflAdvModel;
+
+
+static void
+CReflAdvModel_dealloc(CReflAdvModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CReflAdvModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CReflAdvModel *self;
+    
+    self = (CReflAdvModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CReflAdvModel_init(CReflAdvModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new ReflAdvModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"sldIM_flat4",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat8",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat9",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"sldIM_flat7",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldIM_flat10",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldIM_flat5",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat1",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat3",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"n_layers",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat6",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat7",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat4",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat5",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter0",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter1",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"sld_bottom0",Py_BuildValue("d",0.000002070000));
+        PyDict_SetItemString(self->params,"thick_inter3",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter4",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter5",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter6",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter7",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter8",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter9",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"npts_inter",Py_BuildValue("d",21.000000000000));
+        PyDict_SetItemString(self->params,"sldIM_flat1",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sldIM_flat2",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter9",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter10",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"sldIM_flat3",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter8",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat2",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"func_inter0",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_medium",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"func_inter2",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter3",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat10",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"func_inter5",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter6",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter7",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_flat4",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_flat5",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_flat6",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_flat7",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_flat1",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_flat2",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_flat3",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sldIM_flat8",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_flat8",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_flat9",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sldIM_flat9",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"nu_inter10",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter1",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldIM_sub0",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldIM_medium",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_flat10",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sldIM_flat6",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter4",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter2",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"nu_inter8",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter5",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter4",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter7",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter6",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter1",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter0",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter3",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter2",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter9",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"func_inter10",Py_BuildValue("d",0.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->thick_inter0.dispersion->accept_as_source(visitor, self->model->thick_inter0.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_inter0", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CReflAdvModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CReflAdvModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CReflAdvModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CReflAdvModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CReflAdvModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(ReflAdvModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( ReflAdvModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CReflAdvModelError, 
+                   "CReflAdvModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CReflAdvModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") );
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") );
+    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") );
+    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->n_layers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_layers") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->sld_bottom0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bottom0") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->sld_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_medium") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") );
+    self->model->nu_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter10") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") );
+    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->nu_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter8") );
+    self->model->nu_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter5") );
+    self->model->nu_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter4") );
+    self->model->nu_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter7") );
+    self->model->nu_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter6") );
+    self->model->nu_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter1") );
+    self->model->nu_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter0") );
+    self->model->nu_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter3") );
+    self->model->nu_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter2") );
+    self->model->nu_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter9") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CReflAdvModelError, 
+	    	"CReflAdvModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CReflAdvModelError, 
+                   "CReflAdvModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CReflAdvModelError, 
+	    		"CReflAdvModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CReflAdvModelError, 
+                   "CReflAdvModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CReflAdvModelError, 
+                   "CReflAdvModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CReflAdvModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") );
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") );
+    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") );
+    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->n_layers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_layers") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->sld_bottom0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bottom0") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->sld_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_medium") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") );
+    self->model->nu_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter10") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") );
+    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->nu_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter8") );
+    self->model->nu_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter5") );
+    self->model->nu_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter4") );
+    self->model->nu_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter7") );
+    self->model->nu_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter6") );
+    self->model->nu_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter1") );
+    self->model->nu_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter0") );
+    self->model->nu_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter3") );
+    self->model->nu_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter2") );
+    self->model->nu_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter9") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CReflAdvModelError, 
+	    	"CReflAdvModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CReflAdvModelError, 
+	    		"CReflAdvModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CReflAdvModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CReflAdvModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CReflAdvModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CReflAdvModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") );
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") );
+    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") );
+    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->n_layers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_layers") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->sld_bottom0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bottom0") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->sld_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_medium") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") );
+    self->model->nu_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter10") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") );
+    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->nu_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter8") );
+    self->model->nu_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter5") );
+    self->model->nu_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter4") );
+    self->model->nu_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter7") );
+    self->model->nu_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter6") );
+    self->model->nu_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter1") );
+    self->model->nu_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter0") );
+    self->model->nu_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter3") );
+    self->model->nu_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter2") );
+    self->model->nu_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter9") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CReflAdvModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") );
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") );
+    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") );
+    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->n_layers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_layers") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->sld_bottom0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bottom0") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->sld_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_medium") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") );
+    self->model->nu_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter10") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") );
+    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->nu_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter8") );
+    self->model->nu_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter5") );
+    self->model->nu_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter4") );
+    self->model->nu_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter7") );
+    self->model->nu_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter6") );
+    self->model->nu_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter1") );
+    self->model->nu_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter0") );
+    self->model->nu_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter3") );
+    self->model->nu_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter2") );
+    self->model->nu_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter9") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CReflAdvModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") );
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") );
+    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") );
+    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->n_layers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_layers") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->sld_bottom0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bottom0") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->sld_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_medium") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") );
+    self->model->nu_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter10") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") );
+    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->nu_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter8") );
+    self->model->nu_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter5") );
+    self->model->nu_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter4") );
+    self->model->nu_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter7") );
+    self->model->nu_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter6") );
+    self->model->nu_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter1") );
+    self->model->nu_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter0") );
+    self->model->nu_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter3") );
+    self->model->nu_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter2") );
+    self->model->nu_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter9") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CReflAdvModelError, 
+	    	"CReflAdvModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CReflAdvModelError, 
+	    		"CReflAdvModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CReflAdvModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CReflAdvModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CReflAdvModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CReflAdvModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CReflAdvModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CReflAdvModelError,
+	    	"CReflAdvModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "thick_inter0")) {
+        self->model->thick_inter0.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CReflAdvModelError,
+	    	"CReflAdvModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CReflAdvModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CReflAdvModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CReflAdvModel",             /*tp_name*/
+    sizeof(CReflAdvModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CReflAdvModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CReflAdvModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CReflAdvModel_methods,             /* tp_methods */
+    CReflAdvModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CReflAdvModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CReflAdvModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCReflAdvModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CReflAdvModelType) < 0)
+        return;
+
+    Py_INCREF(&CReflAdvModelType);
+    PyModule_AddObject(module, "CReflAdvModel", (PyObject *)&CReflAdvModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CReflAdvModel.error";
+    CReflAdvModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CReflAdvModelError", CReflAdvModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CReflModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CReflModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CReflModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,834 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CReflModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\refl.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "refl.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CReflModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    ReflModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CReflModel;
+
+
+static void
+CReflModel_dealloc(CReflModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CReflModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CReflModel *self;
+    
+    self = (CReflModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CReflModel_init(CReflModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new ReflModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"thick_flat8",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat9",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat1",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat3",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"n_layers",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat6",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat7",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat4",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat5",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter0",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter1",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sld_bottom0",Py_BuildValue("d",0.000002070000));
+        PyDict_SetItemString(self->params,"thick_inter3",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter4",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter5",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter6",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter7",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter8",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter9",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"func_inter9",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter10",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"func_inter8",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat2",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"func_inter0",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_medium",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"func_inter2",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter3",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat10",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"func_inter5",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter6",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter7",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_flat4",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_flat5",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_flat6",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_flat7",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_flat1",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_flat2",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_flat3",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_flat8",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_flat9",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter1",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_flat10",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"func_inter4",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter2",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"func_inter10",Py_BuildValue("d",0.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->thick_inter0.dispersion->accept_as_source(visitor, self->model->thick_inter0.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_inter0", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CReflModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CReflModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CReflModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CReflModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CReflModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(ReflModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( ReflModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CReflModelError, 
+                   "CReflModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CReflModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->n_layers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_layers") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->sld_bottom0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bottom0") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->sld_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_medium") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CReflModelError, 
+	    	"CReflModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CReflModelError, 
+                   "CReflModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CReflModelError, 
+	    		"CReflModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CReflModelError, 
+                   "CReflModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CReflModelError, 
+                   "CReflModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CReflModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->n_layers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_layers") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->sld_bottom0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bottom0") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->sld_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_medium") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CReflModelError, 
+	    	"CReflModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CReflModelError, 
+	    		"CReflModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CReflModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CReflModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CReflModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CReflModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->n_layers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_layers") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->sld_bottom0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bottom0") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->sld_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_medium") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CReflModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->n_layers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_layers") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->sld_bottom0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bottom0") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->sld_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_medium") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CReflModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->n_layers = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_layers") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->sld_bottom0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_bottom0") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->sld_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_medium") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CReflModelError, 
+	    	"CReflModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CReflModelError, 
+	    		"CReflModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CReflModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CReflModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CReflModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CReflModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CReflModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CReflModelError,
+	    	"CReflModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "thick_inter0")) {
+        self->model->thick_inter0.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CReflModelError,
+	    	"CReflModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CReflModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CReflModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CReflModel",             /*tp_name*/
+    sizeof(CReflModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CReflModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CReflModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CReflModel_methods,             /* tp_methods */
+    CReflModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CReflModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CReflModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCReflModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CReflModelType) < 0)
+        return;
+
+    Py_INCREF(&CReflModelType);
+    PyModule_AddObject(module, "CReflModel", (PyObject *)&CReflModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CReflModel.error";
+    CReflModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CReflModelError", CReflModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CSCCrystalModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CSCCrystalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CSCCrystalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,657 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CSCCrystalModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\sc.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "sc.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CSCCrystalModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    SCCrystalModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CSCCrystalModel;
+
+
+static void
+CSCCrystalModel_dealloc(CSCCrystalModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CSCCrystalModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CSCCrystalModel *self;
+    
+    self = (CSCCrystalModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CSCCrystalModel_init(CSCCrystalModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new SCCrystalModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"dnn",Py_BuildValue("d",220.000000000000));
+        PyDict_SetItemString(self->params,"sldSph",Py_BuildValue("d",0.000003000000));
+        PyDict_SetItemString(self->params,"d_factor",Py_BuildValue("d",0.060000000000));
+        PyDict_SetItemString(self->params,"psi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",40.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000006300000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->phi.dispersion->accept_as_source(visitor, self->model->phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->psi.dispersion->accept_as_source(visitor, self->model->psi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "psi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->theta.dispersion->accept_as_source(visitor, self->model->theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "theta", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CSCCrystalModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CSCCrystalModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CSCCrystalModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CSCCrystalModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CSCCrystalModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(SCCrystalModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( SCCrystalModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CSCCrystalModelError, 
+                   "CSCCrystalModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CSCCrystalModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSCCrystalModelError, 
+	    	"CSCCrystalModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CSCCrystalModelError, 
+                   "CSCCrystalModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CSCCrystalModelError, 
+	    		"CSCCrystalModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CSCCrystalModelError, 
+                   "CSCCrystalModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CSCCrystalModelError, 
+                   "CSCCrystalModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CSCCrystalModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSCCrystalModelError, 
+	    	"CSCCrystalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSCCrystalModelError, 
+	    		"CSCCrystalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CSCCrystalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CSCCrystalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CSCCrystalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CSCCrystalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CSCCrystalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CSCCrystalModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "phi") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->dnn = PyFloat_AsDouble( PyDict_GetItemString(self->params, "dnn") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->d_factor = PyFloat_AsDouble( PyDict_GetItemString(self->params, "d_factor") );
+    self->model->psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "psi") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "theta") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "phi");
+    self->model->phi.dispersion->accept_as_destination(visitor, self->model->phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "psi");
+    self->model->psi.dispersion->accept_as_destination(visitor, self->model->psi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "theta");
+    self->model->theta.dispersion->accept_as_destination(visitor, self->model->theta.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSCCrystalModelError, 
+	    	"CSCCrystalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSCCrystalModelError, 
+	    		"CSCCrystalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CSCCrystalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CSCCrystalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CSCCrystalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CSCCrystalModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CSCCrystalModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CSCCrystalModelError,
+	    	"CSCCrystalModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "phi")) {
+        self->model->phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "psi")) {
+        self->model->psi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "theta")) {
+        self->model->theta.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CSCCrystalModelError,
+	    	"CSCCrystalModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CSCCrystalModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CSCCrystalModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CSCCrystalModel",             /*tp_name*/
+    sizeof(CSCCrystalModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CSCCrystalModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CSCCrystalModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CSCCrystalModel_methods,             /* tp_methods */
+    CSCCrystalModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CSCCrystalModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CSCCrystalModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCSCCrystalModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CSCCrystalModelType) < 0)
+        return;
+
+    Py_INCREF(&CSCCrystalModelType);
+    PyModule_AddObject(module, "CSCCrystalModel", (PyObject *)&CSCCrystalModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CSCCrystalModel.error";
+    CSCCrystalModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CSCCrystalModelError", CSCCrystalModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CSLDCalFunc.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CSLDCalFunc.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CSLDCalFunc.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,588 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CSLDCalFunc
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\sld_cal.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "sld_cal.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CSLDCalFuncError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    SLDCalFunc * model;
+    /// Log for unit testing
+    PyObject * log;
+} CSLDCalFunc;
+
+
+static void
+CSLDCalFunc_dealloc(CSLDCalFunc* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CSLDCalFunc_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CSLDCalFunc *self;
+    
+    self = (CSLDCalFunc *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CSLDCalFunc_init(CSLDCalFunc *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new SLDCalFunc();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"fun_type",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"nu_inter",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"shell_num",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_right",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_left",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"npts_inter",Py_BuildValue("d",21.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->npts_inter.dispersion->accept_as_source(visitor, self->model->npts_inter.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "npts_inter", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CSLDCalFunc_members[] = {
+    {name_params, T_OBJECT, offsetof(CSLDCalFunc, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CSLDCalFunc, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CSLDCalFunc, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CSLDCalFunc_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(SLDCalFunc* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( SLDCalFunc* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CSLDCalFuncError, 
+                   "CSLDCalFunc.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CSLDCalFunc *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->fun_type = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fun_type") );
+    self->model->nu_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter") );
+    self->model->shell_num = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_num") );
+    self->model->sld_right = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_right") );
+    self->model->sld_left = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_left") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "npts_inter");
+    self->model->npts_inter.dispersion->accept_as_destination(visitor, self->model->npts_inter.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSLDCalFuncError, 
+	    	"CSLDCalFunc.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CSLDCalFuncError, 
+                   "CSLDCalFunc.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CSLDCalFuncError, 
+	    		"CSLDCalFunc.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CSLDCalFuncError, 
+                   "CSLDCalFunc.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CSLDCalFuncError, 
+                   "CSLDCalFunc.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CSLDCalFunc *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->fun_type = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fun_type") );
+    self->model->nu_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter") );
+    self->model->shell_num = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_num") );
+    self->model->sld_right = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_right") );
+    self->model->sld_left = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_left") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "npts_inter");
+    self->model->npts_inter.dispersion->accept_as_destination(visitor, self->model->npts_inter.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSLDCalFuncError, 
+	    	"CSLDCalFunc.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSLDCalFuncError, 
+	    		"CSLDCalFunc.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CSLDCalFunc_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CSLDCalFunc_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CSLDCalFunc_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CSLDCalFunc *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->fun_type = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fun_type") );
+    self->model->nu_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter") );
+    self->model->shell_num = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_num") );
+    self->model->sld_right = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_right") );
+    self->model->sld_left = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_left") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "npts_inter");
+    self->model->npts_inter.dispersion->accept_as_destination(visitor, self->model->npts_inter.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CSLDCalFunc *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->fun_type = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fun_type") );
+    self->model->nu_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter") );
+    self->model->shell_num = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_num") );
+    self->model->sld_right = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_right") );
+    self->model->sld_left = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_left") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "npts_inter");
+    self->model->npts_inter.dispersion->accept_as_destination(visitor, self->model->npts_inter.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CSLDCalFunc *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->fun_type = PyFloat_AsDouble( PyDict_GetItemString(self->params, "fun_type") );
+    self->model->nu_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter") );
+    self->model->shell_num = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_num") );
+    self->model->sld_right = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_right") );
+    self->model->sld_left = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_left") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "npts_inter");
+    self->model->npts_inter.dispersion->accept_as_destination(visitor, self->model->npts_inter.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSLDCalFuncError, 
+	    	"CSLDCalFunc.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSLDCalFuncError, 
+	    		"CSLDCalFunc.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CSLDCalFunc_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CSLDCalFunc_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CSLDCalFunc_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CSLDCalFunc *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CSLDCalFunc *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CSLDCalFuncError,
+	    	"CSLDCalFunc.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "npts_inter")) {
+        self->model->npts_inter.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CSLDCalFuncError,
+	    	"CSLDCalFunc.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CSLDCalFunc_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CSLDCalFuncType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CSLDCalFunc",             /*tp_name*/
+    sizeof(CSLDCalFunc),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CSLDCalFunc_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CSLDCalFunc objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CSLDCalFunc_methods,             /* tp_methods */
+    CSLDCalFunc_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CSLDCalFunc_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CSLDCalFunc_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCSLDCalFunc(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CSLDCalFuncType) < 0)
+        return;
+
+    Py_INCREF(&CSLDCalFuncType);
+    PyModule_AddObject(module, "CSLDCalFunc", (PyObject *)&CSLDCalFuncType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CSLDCalFunc.error";
+    CSLDCalFuncError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CSLDCalFuncError", CSLDCalFuncError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CSchulz.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CSchulz.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CSchulz.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,537 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CSchulz
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\schulz.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "schulz.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CSchulzError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    Schulz * model;
+    /// Log for unit testing
+    PyObject * log;
+} CSchulz;
+
+
+static void
+CSchulz_dealloc(CSchulz* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CSchulz_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CSchulz *self;
+    
+    self = (CSchulz *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CSchulz_init(CSchulz *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new Schulz();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sigma",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"center",Py_BuildValue("d",0.000000000000));
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CSchulz_members[] = {
+    {name_params, T_OBJECT, offsetof(CSchulz, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CSchulz, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CSchulz, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CSchulz_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(Schulz* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( Schulz* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CSchulzError, 
+                   "CSchulz.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CSchulz *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSchulzError, 
+	    	"CSchulz.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CSchulzError, 
+                   "CSchulz.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CSchulzError, 
+	    		"CSchulz.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CSchulzError, 
+                   "CSchulz.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CSchulzError, 
+                   "CSchulz.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CSchulz *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSchulzError, 
+	    	"CSchulz.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSchulzError, 
+	    		"CSchulz.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CSchulz_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CSchulz_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CSchulz_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CSchulz *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CSchulz *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CSchulz *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->sigma = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma") );
+    self->model->center = PyFloat_AsDouble( PyDict_GetItemString(self->params, "center") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSchulzError, 
+	    	"CSchulz.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSchulzError, 
+	    		"CSchulz.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CSchulz_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CSchulz_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CSchulz_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CSchulz *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CSchulz *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CSchulzError,
+	    	"CSchulz.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+ {
+	    PyErr_SetString(CSchulzError,
+	    	"CSchulz.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CSchulz_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CSchulzType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CSchulz",             /*tp_name*/
+    sizeof(CSchulz),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CSchulz_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CSchulz objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CSchulz_methods,             /* tp_methods */
+    CSchulz_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CSchulz_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CSchulz_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCSchulz(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CSchulzType) < 0)
+        return;
+
+    Py_INCREF(&CSchulzType);
+    PyModule_AddObject(module, "CSchulz", (PyObject *)&CSchulzType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CSchulz.error";
+    CSchulzError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CSchulzError", CSchulzError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CSphereModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CSphereModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CSphereModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,636 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CSphereModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\sphere.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "sphere.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CSphereModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    SphereModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CSphereModel;
+
+
+static void
+CSphereModel_dealloc(CSphereModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CSphereModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CSphereModel *self;
+    
+    self = (CSphereModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CSphereModel_init(CSphereModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new SphereModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"Up_frac_i",Py_BuildValue("d",0.500000000000));
+        PyDict_SetItemString(self->params,"Up_theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_sph",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldSph",Py_BuildValue("d",0.000002000000));
+        PyDict_SetItemString(self->params,"M_theta_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M_phi_solv",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"M0_sld_sph",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"Up_frac_f",Py_BuildValue("d",0.500000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",60.000000000000));
+        PyDict_SetItemString(self->params,"M_theta_sph",Py_BuildValue("d",0.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CSphereModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CSphereModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CSphereModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CSphereModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CSphereModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(SphereModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( SphereModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CSphereModelError, 
+                   "CSphereModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CSphereModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->M_phi_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_sph") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_sph") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->M_theta_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_sph") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSphereModelError, 
+	    	"CSphereModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CSphereModelError, 
+                   "CSphereModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CSphereModelError, 
+	    		"CSphereModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CSphereModelError, 
+                   "CSphereModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CSphereModelError, 
+                   "CSphereModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CSphereModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->M_phi_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_sph") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_sph") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->M_theta_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_sph") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSphereModelError, 
+	    	"CSphereModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSphereModelError, 
+	    		"CSphereModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CSphereModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CSphereModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CSphereModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CSphereModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->M_phi_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_sph") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_sph") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->M_theta_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_sph") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CSphereModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->M_phi_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_sph") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_sph") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->M_theta_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_sph") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CSphereModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->Up_frac_i = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_i") );
+    self->model->Up_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_theta") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->M_phi_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_sph") );
+    self->model->M0_sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_solv") );
+    self->model->sldSph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSph") );
+    self->model->M_theta_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_solv") );
+    self->model->M_phi_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_phi_solv") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->M0_sld_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M0_sld_sph") );
+    self->model->Up_frac_f = PyFloat_AsDouble( PyDict_GetItemString(self->params, "Up_frac_f") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->M_theta_sph = PyFloat_AsDouble( PyDict_GetItemString(self->params, "M_theta_sph") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSphereModelError, 
+	    	"CSphereModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSphereModelError, 
+	    		"CSphereModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CSphereModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CSphereModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CSphereModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CSphereModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CSphereModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CSphereModelError,
+	    	"CSphereModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CSphereModelError,
+	    	"CSphereModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CSphereModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CSphereModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CSphereModel",             /*tp_name*/
+    sizeof(CSphereModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CSphereModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CSphereModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CSphereModel_methods,             /* tp_methods */
+    CSphereModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CSphereModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CSphereModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCSphereModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CSphereModelType) < 0)
+        return;
+
+    Py_INCREF(&CSphereModelType);
+    PyModule_AddObject(module, "CSphereModel", (PyObject *)&CSphereModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CSphereModel.error";
+    CSphereModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CSphereModelError", CSphereModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CSphereSLDModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CSphereSLDModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CSphereSLDModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,927 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CSphereSLDModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\spheresld.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "spheresld.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CSphereSLDModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    SphereSLDModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CSphereSLDModel;
+
+
+static void
+CSphereSLDModel_dealloc(CSphereSLDModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CSphereSLDModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CSphereSLDModel *self;
+    
+    self = (CSphereSLDModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CSphereSLDModel_init(CSphereSLDModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new SphereSLDModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"thick_flat8",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat9",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat2",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat3",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat1",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat6",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat7",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat4",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat5",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter0",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter1",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter2",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter3",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"sld_core0",Py_BuildValue("d",0.000002070000));
+        PyDict_SetItemString(self->params,"thick_inter5",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter6",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter7",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter8",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter9",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"rad_core0",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"npts_inter",Py_BuildValue("d",35.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thick_inter10",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"func_inter8",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter9",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000001000000));
+        PyDict_SetItemString(self->params,"func_inter0",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter1",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter2",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter3",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"thick_flat10",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"func_inter5",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter6",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"func_inter7",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sld_flat4",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_flat5",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_flat6",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_flat7",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_flat1",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_flat2",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_flat3",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"sld_flat8",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"sld_flat9",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"nu_inter10",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"n_shells",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"sld_flat10",Py_BuildValue("d",0.000003500000));
+        PyDict_SetItemString(self->params,"func_inter4",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"nu_inter8",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter5",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter4",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter7",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter6",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter1",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter0",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter3",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"nu_inter2",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"thick_inter4",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"nu_inter9",Py_BuildValue("d",2.500000000000));
+        PyDict_SetItemString(self->params,"func_inter10",Py_BuildValue("d",0.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->rad_core0.dispersion->accept_as_source(visitor, self->model->rad_core0.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "rad_core0", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thick_inter0.dispersion->accept_as_source(visitor, self->model->thick_inter0.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thick_inter0", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CSphereSLDModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CSphereSLDModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CSphereSLDModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CSphereSLDModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CSphereSLDModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(SphereSLDModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( SphereSLDModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CSphereSLDModelError, 
+                   "CSphereSLDModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CSphereSLDModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->nu_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter10") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->n_shells = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_shells") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->nu_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter8") );
+    self->model->nu_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter5") );
+    self->model->nu_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter4") );
+    self->model->nu_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter7") );
+    self->model->nu_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter6") );
+    self->model->nu_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter1") );
+    self->model->nu_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter0") );
+    self->model->nu_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter3") );
+    self->model->nu_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter2") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->nu_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter9") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSphereSLDModelError, 
+	    	"CSphereSLDModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CSphereSLDModelError, 
+                   "CSphereSLDModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CSphereSLDModelError, 
+	    		"CSphereSLDModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CSphereSLDModelError, 
+                   "CSphereSLDModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CSphereSLDModelError, 
+                   "CSphereSLDModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CSphereSLDModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->nu_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter10") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->n_shells = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_shells") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->nu_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter8") );
+    self->model->nu_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter5") );
+    self->model->nu_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter4") );
+    self->model->nu_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter7") );
+    self->model->nu_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter6") );
+    self->model->nu_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter1") );
+    self->model->nu_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter0") );
+    self->model->nu_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter3") );
+    self->model->nu_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter2") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->nu_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter9") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSphereSLDModelError, 
+	    	"CSphereSLDModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSphereSLDModelError, 
+	    		"CSphereSLDModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CSphereSLDModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CSphereSLDModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CSphereSLDModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CSphereSLDModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->nu_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter10") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->n_shells = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_shells") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->nu_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter8") );
+    self->model->nu_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter5") );
+    self->model->nu_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter4") );
+    self->model->nu_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter7") );
+    self->model->nu_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter6") );
+    self->model->nu_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter1") );
+    self->model->nu_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter0") );
+    self->model->nu_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter3") );
+    self->model->nu_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter2") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->nu_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter9") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CSphereSLDModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->nu_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter10") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->n_shells = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_shells") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->nu_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter8") );
+    self->model->nu_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter5") );
+    self->model->nu_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter4") );
+    self->model->nu_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter7") );
+    self->model->nu_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter6") );
+    self->model->nu_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter1") );
+    self->model->nu_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter0") );
+    self->model->nu_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter3") );
+    self->model->nu_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter2") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->nu_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter9") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CSphereSLDModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") );
+    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") );
+    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") );
+    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") );
+    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") );
+    self->model->thick_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat6") );
+    self->model->thick_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat7") );
+    self->model->thick_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat4") );
+    self->model->thick_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat5") );
+    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") );
+    self->model->thick_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter1") );
+    self->model->thick_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter2") );
+    self->model->thick_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter3") );
+    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") );
+    self->model->thick_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter5") );
+    self->model->thick_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter6") );
+    self->model->thick_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter7") );
+    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") );
+    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") );
+    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") );
+    self->model->npts_inter = PyFloat_AsDouble( PyDict_GetItemString(self->params, "npts_inter") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") );
+    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") );
+    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") );
+    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") );
+    self->model->func_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter0") );
+    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") );
+    self->model->func_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter2") );
+    self->model->func_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter3") );
+    self->model->thick_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat10") );
+    self->model->func_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter5") );
+    self->model->func_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter6") );
+    self->model->func_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter7") );
+    self->model->sld_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat4") );
+    self->model->sld_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat5") );
+    self->model->sld_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat6") );
+    self->model->sld_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat7") );
+    self->model->sld_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat1") );
+    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") );
+    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") );
+    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") );
+    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") );
+    self->model->nu_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter10") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->n_shells = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_shells") );
+    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") );
+    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") );
+    self->model->nu_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter8") );
+    self->model->nu_inter5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter5") );
+    self->model->nu_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter4") );
+    self->model->nu_inter7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter7") );
+    self->model->nu_inter6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter6") );
+    self->model->nu_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter1") );
+    self->model->nu_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter0") );
+    self->model->nu_inter3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter3") );
+    self->model->nu_inter2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter2") );
+    self->model->thick_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter4") );
+    self->model->nu_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "nu_inter9") );
+    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0");
+    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thick_inter0");
+    self->model->thick_inter0.dispersion->accept_as_destination(visitor, self->model->thick_inter0.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSphereSLDModelError, 
+	    	"CSphereSLDModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSphereSLDModelError, 
+	    		"CSphereSLDModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CSphereSLDModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CSphereSLDModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CSphereSLDModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CSphereSLDModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CSphereSLDModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CSphereSLDModelError,
+	    	"CSphereSLDModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "rad_core0")) {
+        self->model->rad_core0.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thick_inter0")) {
+        self->model->thick_inter0.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CSphereSLDModelError,
+	    	"CSphereSLDModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CSphereSLDModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CSphereSLDModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CSphereSLDModel",             /*tp_name*/
+    sizeof(CSphereSLDModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CSphereSLDModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CSphereSLDModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CSphereSLDModel_methods,             /* tp_methods */
+    CSphereSLDModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CSphereSLDModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CSphereSLDModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCSphereSLDModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CSphereSLDModelType) < 0)
+        return;
+
+    Py_INCREF(&CSphereSLDModelType);
+    PyModule_AddObject(module, "CSphereSLDModel", (PyObject *)&CSphereSLDModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CSphereSLDModel.error";
+    CSphereSLDModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CSphereSLDModelError", CSphereSLDModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CSquareWellStructure.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CSquareWellStructure.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CSquareWellStructure.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,576 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CSquareWellStructure
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\SquareWell.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "SquareWell.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CSquareWellStructureError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    SquareWellStructure * model;
+    /// Log for unit testing
+    PyObject * log;
+} CSquareWellStructure;
+
+
+static void
+CSquareWellStructure_dealloc(CSquareWellStructure* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CSquareWellStructure_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CSquareWellStructure *self;
+    
+    self = (CSquareWellStructure *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CSquareWellStructure_init(CSquareWellStructure *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new SquareWellStructure();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"welldepth",Py_BuildValue("d",1.500000000000));
+        PyDict_SetItemString(self->params,"effect_radius",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"volfraction",Py_BuildValue("d",0.040000000000));
+        PyDict_SetItemString(self->params,"wellwidth",Py_BuildValue("d",1.200000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->effect_radius.dispersion->accept_as_source(visitor, self->model->effect_radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "effect_radius", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CSquareWellStructure_members[] = {
+    {name_params, T_OBJECT, offsetof(CSquareWellStructure, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CSquareWellStructure, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CSquareWellStructure, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CSquareWellStructure_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(SquareWellStructure* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( SquareWellStructure* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CSquareWellStructureError, 
+                   "CSquareWellStructure.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CSquareWellStructure *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->welldepth = PyFloat_AsDouble( PyDict_GetItemString(self->params, "welldepth") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->wellwidth = PyFloat_AsDouble( PyDict_GetItemString(self->params, "wellwidth") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSquareWellStructureError, 
+	    	"CSquareWellStructure.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CSquareWellStructureError, 
+                   "CSquareWellStructure.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CSquareWellStructureError, 
+	    		"CSquareWellStructure.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CSquareWellStructureError, 
+                   "CSquareWellStructure.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CSquareWellStructureError, 
+                   "CSquareWellStructure.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CSquareWellStructure *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->welldepth = PyFloat_AsDouble( PyDict_GetItemString(self->params, "welldepth") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->wellwidth = PyFloat_AsDouble( PyDict_GetItemString(self->params, "wellwidth") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSquareWellStructureError, 
+	    	"CSquareWellStructure.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSquareWellStructureError, 
+	    		"CSquareWellStructure.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CSquareWellStructure_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CSquareWellStructure_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CSquareWellStructure_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CSquareWellStructure *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->welldepth = PyFloat_AsDouble( PyDict_GetItemString(self->params, "welldepth") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->wellwidth = PyFloat_AsDouble( PyDict_GetItemString(self->params, "wellwidth") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CSquareWellStructure *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->welldepth = PyFloat_AsDouble( PyDict_GetItemString(self->params, "welldepth") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->wellwidth = PyFloat_AsDouble( PyDict_GetItemString(self->params, "wellwidth") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CSquareWellStructure *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->welldepth = PyFloat_AsDouble( PyDict_GetItemString(self->params, "welldepth") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->wellwidth = PyFloat_AsDouble( PyDict_GetItemString(self->params, "wellwidth") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSquareWellStructureError, 
+	    	"CSquareWellStructure.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSquareWellStructureError, 
+	    		"CSquareWellStructure.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CSquareWellStructure_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CSquareWellStructure_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CSquareWellStructure_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CSquareWellStructure *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CSquareWellStructure *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CSquareWellStructureError,
+	    	"CSquareWellStructure.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "effect_radius")) {
+        self->model->effect_radius.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CSquareWellStructureError,
+	    	"CSquareWellStructure.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CSquareWellStructure_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CSquareWellStructureType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CSquareWellStructure",             /*tp_name*/
+    sizeof(CSquareWellStructure),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CSquareWellStructure_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CSquareWellStructure objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CSquareWellStructure_methods,             /* tp_methods */
+    CSquareWellStructure_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CSquareWellStructure_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CSquareWellStructure_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCSquareWellStructure(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CSquareWellStructureType) < 0)
+        return;
+
+    Py_INCREF(&CSquareWellStructureType);
+    PyModule_AddObject(module, "CSquareWellStructure", (PyObject *)&CSquareWellStructureType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CSquareWellStructure.error";
+    CSquareWellStructureError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CSquareWellStructureError", CSquareWellStructureError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CStackedDisksModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CStackedDisksModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CStackedDisksModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,684 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CStackedDisksModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\stacked_disks.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "stacked_disks.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CStackedDisksModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    StackedDisksModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CStackedDisksModel;
+
+
+static void
+CStackedDisksModel_dealloc(CStackedDisksModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CStackedDisksModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CStackedDisksModel *self;
+    
+    self = (CStackedDisksModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CStackedDisksModel_init(CStackedDisksModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new StackedDisksModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"core_sld",Py_BuildValue("d",0.000004000000));
+        PyDict_SetItemString(self->params,"core_thick",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"layer_thick",Py_BuildValue("d",15.000000000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"layer_sld",Py_BuildValue("d",-0.000000400000));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"solvent_sld",Py_BuildValue("d",0.000005000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",0.010000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",3000.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000000000));
+        PyDict_SetItemString(self->params,"sigma_d",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"n_stacking",Py_BuildValue("d",1.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->core_thick.dispersion->accept_as_source(visitor, self->model->core_thick.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "core_thick", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->layer_thick.dispersion->accept_as_source(visitor, self->model->layer_thick.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "layer_thick", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_theta.dispersion->accept_as_source(visitor, self->model->axis_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_theta", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_phi.dispersion->accept_as_source(visitor, self->model->axis_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_phi", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CStackedDisksModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CStackedDisksModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CStackedDisksModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CStackedDisksModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CStackedDisksModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(StackedDisksModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( StackedDisksModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CStackedDisksModelError, 
+                   "CStackedDisksModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CStackedDisksModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_thick") );
+    self->model->layer_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->layer_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_sld") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sigma_d = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma_d") );
+    self->model->n_stacking = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_stacking") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_thick");
+    self->model->core_thick.dispersion->accept_as_destination(visitor, self->model->core_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "layer_thick");
+    self->model->layer_thick.dispersion->accept_as_destination(visitor, self->model->layer_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CStackedDisksModelError, 
+	    	"CStackedDisksModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CStackedDisksModelError, 
+                   "CStackedDisksModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CStackedDisksModelError, 
+	    		"CStackedDisksModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CStackedDisksModelError, 
+                   "CStackedDisksModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CStackedDisksModelError, 
+                   "CStackedDisksModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CStackedDisksModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_thick") );
+    self->model->layer_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->layer_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_sld") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sigma_d = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma_d") );
+    self->model->n_stacking = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_stacking") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_thick");
+    self->model->core_thick.dispersion->accept_as_destination(visitor, self->model->core_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "layer_thick");
+    self->model->layer_thick.dispersion->accept_as_destination(visitor, self->model->layer_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CStackedDisksModelError, 
+	    	"CStackedDisksModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CStackedDisksModelError, 
+	    		"CStackedDisksModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CStackedDisksModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CStackedDisksModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CStackedDisksModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CStackedDisksModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_thick") );
+    self->model->layer_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->layer_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_sld") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sigma_d = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma_d") );
+    self->model->n_stacking = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_stacking") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_thick");
+    self->model->core_thick.dispersion->accept_as_destination(visitor, self->model->core_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "layer_thick");
+    self->model->layer_thick.dispersion->accept_as_destination(visitor, self->model->layer_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CStackedDisksModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_thick") );
+    self->model->layer_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->layer_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_sld") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sigma_d = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma_d") );
+    self->model->n_stacking = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_stacking") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_thick");
+    self->model->core_thick.dispersion->accept_as_destination(visitor, self->model->core_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "layer_thick");
+    self->model->layer_thick.dispersion->accept_as_destination(visitor, self->model->layer_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CStackedDisksModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") );
+    self->model->core_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_thick") );
+    self->model->layer_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_thick") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->layer_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_sld") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sigma_d = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma_d") );
+    self->model->n_stacking = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_stacking") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "core_thick");
+    self->model->core_thick.dispersion->accept_as_destination(visitor, self->model->core_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "layer_thick");
+    self->model->layer_thick.dispersion->accept_as_destination(visitor, self->model->layer_thick.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CStackedDisksModelError, 
+	    	"CStackedDisksModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CStackedDisksModelError, 
+	    		"CStackedDisksModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CStackedDisksModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CStackedDisksModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CStackedDisksModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CStackedDisksModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CStackedDisksModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CStackedDisksModelError,
+	    	"CStackedDisksModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "core_thick")) {
+        self->model->core_thick.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "layer_thick")) {
+        self->model->layer_thick.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_theta")) {
+        self->model->axis_theta.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_phi")) {
+        self->model->axis_phi.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CStackedDisksModelError,
+	    	"CStackedDisksModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CStackedDisksModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CStackedDisksModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CStackedDisksModel",             /*tp_name*/
+    sizeof(CStackedDisksModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CStackedDisksModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CStackedDisksModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CStackedDisksModel_methods,             /* tp_methods */
+    CStackedDisksModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CStackedDisksModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CStackedDisksModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCStackedDisksModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CStackedDisksModelType) < 0)
+        return;
+
+    Py_INCREF(&CStackedDisksModelType);
+    PyModule_AddObject(module, "CStackedDisksModel", (PyObject *)&CStackedDisksModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CStackedDisksModel.error";
+    CStackedDisksModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CStackedDisksModelError", CStackedDisksModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CStarPolymer.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CStarPolymer.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CStarPolymer.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,621 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CStarPolymer
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\starpolymer.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "starpolymer.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CStarPolymerError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    StarPolymer * model;
+    /// Log for unit testing
+    PyObject * log;
+} CStarPolymer;
+
+
+static void
+CStarPolymer_dealloc(CStarPolymer* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CStarPolymer_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CStarPolymer *self;
+    
+    self = (CStarPolymer *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CStarPolymer_init(CStarPolymer *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new StarPolymer();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"arms",Py_BuildValue("d",3.000000000000));
+        PyDict_SetItemString(self->params,"R2",Py_BuildValue("d",100.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->arms.dispersion->accept_as_source(visitor, self->model->arms.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "arms", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->R2.dispersion->accept_as_source(visitor, self->model->R2.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "R2", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->scale.dispersion->accept_as_source(visitor, self->model->scale.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "scale", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->background.dispersion->accept_as_source(visitor, self->model->background.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "background", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CStarPolymer_members[] = {
+    {name_params, T_OBJECT, offsetof(CStarPolymer, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CStarPolymer, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CStarPolymer, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CStarPolymer_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(StarPolymer* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( StarPolymer* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CStarPolymerError, 
+                   "CStarPolymer.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CStarPolymer *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->arms = PyFloat_AsDouble( PyDict_GetItemString(self->params, "arms") );
+    self->model->R2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "R2") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "arms");
+    self->model->arms.dispersion->accept_as_destination(visitor, self->model->arms.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "R2");
+    self->model->R2.dispersion->accept_as_destination(visitor, self->model->R2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CStarPolymerError, 
+	    	"CStarPolymer.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CStarPolymerError, 
+                   "CStarPolymer.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CStarPolymerError, 
+	    		"CStarPolymer.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CStarPolymerError, 
+                   "CStarPolymer.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CStarPolymerError, 
+                   "CStarPolymer.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CStarPolymer *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->arms = PyFloat_AsDouble( PyDict_GetItemString(self->params, "arms") );
+    self->model->R2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "R2") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "arms");
+    self->model->arms.dispersion->accept_as_destination(visitor, self->model->arms.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "R2");
+    self->model->R2.dispersion->accept_as_destination(visitor, self->model->R2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CStarPolymerError, 
+	    	"CStarPolymer.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CStarPolymerError, 
+	    		"CStarPolymer.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CStarPolymer_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CStarPolymer_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CStarPolymer_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CStarPolymer *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->arms = PyFloat_AsDouble( PyDict_GetItemString(self->params, "arms") );
+    self->model->R2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "R2") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "arms");
+    self->model->arms.dispersion->accept_as_destination(visitor, self->model->arms.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "R2");
+    self->model->R2.dispersion->accept_as_destination(visitor, self->model->R2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CStarPolymer *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->arms = PyFloat_AsDouble( PyDict_GetItemString(self->params, "arms") );
+    self->model->R2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "R2") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "arms");
+    self->model->arms.dispersion->accept_as_destination(visitor, self->model->arms.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "R2");
+    self->model->R2.dispersion->accept_as_destination(visitor, self->model->R2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CStarPolymer *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->arms = PyFloat_AsDouble( PyDict_GetItemString(self->params, "arms") );
+    self->model->R2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "R2") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "arms");
+    self->model->arms.dispersion->accept_as_destination(visitor, self->model->arms.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "R2");
+    self->model->R2.dispersion->accept_as_destination(visitor, self->model->R2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CStarPolymerError, 
+	    	"CStarPolymer.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CStarPolymerError, 
+	    		"CStarPolymer.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CStarPolymer_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CStarPolymer_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CStarPolymer_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CStarPolymer *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CStarPolymer *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CStarPolymerError,
+	    	"CStarPolymer.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "arms")) {
+        self->model->arms.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "R2")) {
+        self->model->R2.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "scale")) {
+        self->model->scale.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "background")) {
+        self->model->background.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CStarPolymerError,
+	    	"CStarPolymer.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CStarPolymer_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CStarPolymerType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CStarPolymer",             /*tp_name*/
+    sizeof(CStarPolymer),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CStarPolymer_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CStarPolymer objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CStarPolymer_methods,             /* tp_methods */
+    CStarPolymer_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CStarPolymer_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CStarPolymer_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCStarPolymer(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CStarPolymerType) < 0)
+        return;
+
+    Py_INCREF(&CStarPolymerType);
+    PyModule_AddObject(module, "CStarPolymer", (PyObject *)&CStarPolymerType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CStarPolymer.error";
+    CStarPolymerError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CStarPolymerError", CStarPolymerError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CStickyHSStructure.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CStickyHSStructure.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CStickyHSStructure.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,576 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CStickyHSStructure
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\StickyHS.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "StickyHS.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CStickyHSStructureError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    StickyHSStructure * model;
+    /// Log for unit testing
+    PyObject * log;
+} CStickyHSStructure;
+
+
+static void
+CStickyHSStructure_dealloc(CStickyHSStructure* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CStickyHSStructure_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CStickyHSStructure *self;
+    
+    self = (CStickyHSStructure *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CStickyHSStructure_init(CStickyHSStructure *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new StickyHSStructure();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"stickiness",Py_BuildValue("d",0.200000000000));
+        PyDict_SetItemString(self->params,"effect_radius",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"volfraction",Py_BuildValue("d",0.100000000000));
+        PyDict_SetItemString(self->params,"perturb",Py_BuildValue("d",0.050000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->effect_radius.dispersion->accept_as_source(visitor, self->model->effect_radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "effect_radius", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CStickyHSStructure_members[] = {
+    {name_params, T_OBJECT, offsetof(CStickyHSStructure, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CStickyHSStructure, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CStickyHSStructure, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CStickyHSStructure_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(StickyHSStructure* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( StickyHSStructure* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CStickyHSStructureError, 
+                   "CStickyHSStructure.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CStickyHSStructure *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->stickiness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "stickiness") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->perturb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "perturb") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CStickyHSStructureError, 
+	    	"CStickyHSStructure.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CStickyHSStructureError, 
+                   "CStickyHSStructure.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CStickyHSStructureError, 
+	    		"CStickyHSStructure.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CStickyHSStructureError, 
+                   "CStickyHSStructure.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CStickyHSStructureError, 
+                   "CStickyHSStructure.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CStickyHSStructure *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->stickiness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "stickiness") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->perturb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "perturb") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CStickyHSStructureError, 
+	    	"CStickyHSStructure.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CStickyHSStructureError, 
+	    		"CStickyHSStructure.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CStickyHSStructure_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CStickyHSStructure_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CStickyHSStructure_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CStickyHSStructure *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->stickiness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "stickiness") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->perturb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "perturb") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CStickyHSStructure *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->stickiness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "stickiness") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->perturb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "perturb") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CStickyHSStructure *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->stickiness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "stickiness") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->perturb = PyFloat_AsDouble( PyDict_GetItemString(self->params, "perturb") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "effect_radius");
+    self->model->effect_radius.dispersion->accept_as_destination(visitor, self->model->effect_radius.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CStickyHSStructureError, 
+	    	"CStickyHSStructure.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CStickyHSStructureError, 
+	    		"CStickyHSStructure.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CStickyHSStructure_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CStickyHSStructure_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CStickyHSStructure_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CStickyHSStructure *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CStickyHSStructure *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CStickyHSStructureError,
+	    	"CStickyHSStructure.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "effect_radius")) {
+        self->model->effect_radius.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CStickyHSStructureError,
+	    	"CStickyHSStructure.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CStickyHSStructure_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CStickyHSStructureType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CStickyHSStructure",             /*tp_name*/
+    sizeof(CStickyHSStructure),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CStickyHSStructure_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CStickyHSStructure objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CStickyHSStructure_methods,             /* tp_methods */
+    CStickyHSStructure_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CStickyHSStructure_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CStickyHSStructure_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCStickyHSStructure(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CStickyHSStructureType) < 0)
+        return;
+
+    Py_INCREF(&CStickyHSStructureType);
+    PyModule_AddObject(module, "CStickyHSStructure", (PyObject *)&CStickyHSStructureType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CStickyHSStructure.error";
+    CStickyHSStructureError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CStickyHSStructureError", CStickyHSStructureError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CSurfaceFractalModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CSurfaceFractalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CSurfaceFractalModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,549 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CSurfaceFractalModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\surfacefractal.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "surfacefractal.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CSurfaceFractalModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    SurfaceFractalModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CSurfaceFractalModel;
+
+
+static void
+CSurfaceFractalModel_dealloc(CSurfaceFractalModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CSurfaceFractalModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CSurfaceFractalModel *self;
+    
+    self = (CSurfaceFractalModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CSurfaceFractalModel_init(CSurfaceFractalModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new SurfaceFractalModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"co_length",Py_BuildValue("d",500.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"surface_dim",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CSurfaceFractalModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CSurfaceFractalModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CSurfaceFractalModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CSurfaceFractalModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CSurfaceFractalModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(SurfaceFractalModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( SurfaceFractalModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CSurfaceFractalModelError, 
+                   "CSurfaceFractalModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CSurfaceFractalModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->co_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "co_length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->surface_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surface_dim") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSurfaceFractalModelError, 
+	    	"CSurfaceFractalModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CSurfaceFractalModelError, 
+                   "CSurfaceFractalModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CSurfaceFractalModelError, 
+	    		"CSurfaceFractalModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CSurfaceFractalModelError, 
+                   "CSurfaceFractalModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CSurfaceFractalModelError, 
+                   "CSurfaceFractalModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CSurfaceFractalModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->co_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "co_length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->surface_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surface_dim") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSurfaceFractalModelError, 
+	    	"CSurfaceFractalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSurfaceFractalModelError, 
+	    		"CSurfaceFractalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CSurfaceFractalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CSurfaceFractalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CSurfaceFractalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CSurfaceFractalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->co_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "co_length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->surface_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surface_dim") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CSurfaceFractalModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->co_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "co_length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->surface_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surface_dim") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CSurfaceFractalModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->co_length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "co_length") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->surface_dim = PyFloat_AsDouble( PyDict_GetItemString(self->params, "surface_dim") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CSurfaceFractalModelError, 
+	    	"CSurfaceFractalModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CSurfaceFractalModelError, 
+	    		"CSurfaceFractalModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CSurfaceFractalModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CSurfaceFractalModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CSurfaceFractalModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CSurfaceFractalModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CSurfaceFractalModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CSurfaceFractalModelError,
+	    	"CSurfaceFractalModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+ {
+	    PyErr_SetString(CSurfaceFractalModelError,
+	    	"CSurfaceFractalModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CSurfaceFractalModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CSurfaceFractalModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CSurfaceFractalModel",             /*tp_name*/
+    sizeof(CSurfaceFractalModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CSurfaceFractalModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CSurfaceFractalModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CSurfaceFractalModel_methods,             /* tp_methods */
+    CSurfaceFractalModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CSurfaceFractalModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CSurfaceFractalModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCSurfaceFractalModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CSurfaceFractalModelType) < 0)
+        return;
+
+    Py_INCREF(&CSurfaceFractalModelType);
+    PyModule_AddObject(module, "CSurfaceFractalModel", (PyObject *)&CSurfaceFractalModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CSurfaceFractalModel.error";
+    CSurfaceFractalModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CSurfaceFractalModelError", CSurfaceFractalModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CTeubnerStreyModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CTeubnerStreyModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CTeubnerStreyModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,621 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CTeubnerStreyModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\teubner_strey.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "teubner_strey.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CTeubnerStreyModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    TeubnerStreyModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CTeubnerStreyModel;
+
+
+static void
+CTeubnerStreyModel_dealloc(CTeubnerStreyModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CTeubnerStreyModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CTeubnerStreyModel *self;
+    
+    self = (CTeubnerStreyModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CTeubnerStreyModel_init(CTeubnerStreyModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new TeubnerStreyModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"c2",Py_BuildValue("d",5000.000000000000));
+        PyDict_SetItemString(self->params,"c1",Py_BuildValue("d",-30.000000000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",0.100000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->scale.dispersion->accept_as_source(visitor, self->model->scale.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "scale", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->c1.dispersion->accept_as_source(visitor, self->model->c1.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "c1", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->c2.dispersion->accept_as_source(visitor, self->model->c2.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "c2", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->background.dispersion->accept_as_source(visitor, self->model->background.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "background", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CTeubnerStreyModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CTeubnerStreyModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CTeubnerStreyModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CTeubnerStreyModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CTeubnerStreyModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(TeubnerStreyModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( TeubnerStreyModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CTeubnerStreyModelError, 
+                   "CTeubnerStreyModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CTeubnerStreyModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->c2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2") );
+    self->model->c1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c1") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c1");
+    self->model->c1.dispersion->accept_as_destination(visitor, self->model->c1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2");
+    self->model->c2.dispersion->accept_as_destination(visitor, self->model->c2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CTeubnerStreyModelError, 
+	    	"CTeubnerStreyModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CTeubnerStreyModelError, 
+                   "CTeubnerStreyModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CTeubnerStreyModelError, 
+	    		"CTeubnerStreyModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CTeubnerStreyModelError, 
+                   "CTeubnerStreyModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CTeubnerStreyModelError, 
+                   "CTeubnerStreyModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CTeubnerStreyModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->c2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2") );
+    self->model->c1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c1") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c1");
+    self->model->c1.dispersion->accept_as_destination(visitor, self->model->c1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2");
+    self->model->c2.dispersion->accept_as_destination(visitor, self->model->c2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CTeubnerStreyModelError, 
+	    	"CTeubnerStreyModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CTeubnerStreyModelError, 
+	    		"CTeubnerStreyModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CTeubnerStreyModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CTeubnerStreyModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CTeubnerStreyModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CTeubnerStreyModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->c2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2") );
+    self->model->c1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c1") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c1");
+    self->model->c1.dispersion->accept_as_destination(visitor, self->model->c1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2");
+    self->model->c2.dispersion->accept_as_destination(visitor, self->model->c2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CTeubnerStreyModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->c2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2") );
+    self->model->c1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c1") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c1");
+    self->model->c1.dispersion->accept_as_destination(visitor, self->model->c1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2");
+    self->model->c2.dispersion->accept_as_destination(visitor, self->model->c2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CTeubnerStreyModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->c2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c2") );
+    self->model->c1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "c1") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "scale");
+    self->model->scale.dispersion->accept_as_destination(visitor, self->model->scale.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c1");
+    self->model->c1.dispersion->accept_as_destination(visitor, self->model->c1.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "c2");
+    self->model->c2.dispersion->accept_as_destination(visitor, self->model->c2.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "background");
+    self->model->background.dispersion->accept_as_destination(visitor, self->model->background.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CTeubnerStreyModelError, 
+	    	"CTeubnerStreyModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CTeubnerStreyModelError, 
+	    		"CTeubnerStreyModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CTeubnerStreyModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CTeubnerStreyModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CTeubnerStreyModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CTeubnerStreyModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CTeubnerStreyModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CTeubnerStreyModelError,
+	    	"CTeubnerStreyModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "scale")) {
+        self->model->scale.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "c1")) {
+        self->model->c1.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "c2")) {
+        self->model->c2.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "background")) {
+        self->model->background.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CTeubnerStreyModelError,
+	    	"CTeubnerStreyModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CTeubnerStreyModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CTeubnerStreyModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CTeubnerStreyModel",             /*tp_name*/
+    sizeof(CTeubnerStreyModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CTeubnerStreyModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CTeubnerStreyModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CTeubnerStreyModel_methods,             /* tp_methods */
+    CTeubnerStreyModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CTeubnerStreyModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CTeubnerStreyModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCTeubnerStreyModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CTeubnerStreyModelType) < 0)
+        return;
+
+    Py_INCREF(&CTeubnerStreyModelType);
+    PyModule_AddObject(module, "CTeubnerStreyModel", (PyObject *)&CTeubnerStreyModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CTeubnerStreyModel.error";
+    CTeubnerStreyModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CTeubnerStreyModelError", CTeubnerStreyModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CTriaxialEllipsoidModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CTriaxialEllipsoidModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CTriaxialEllipsoidModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,687 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CTriaxialEllipsoidModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\triaxial_ellipsoid.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "triaxial_ellipsoid.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CTriaxialEllipsoidModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    TriaxialEllipsoidModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CTriaxialEllipsoidModel;
+
+
+static void
+CTriaxialEllipsoidModel_dealloc(CTriaxialEllipsoidModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CTriaxialEllipsoidModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CTriaxialEllipsoidModel *self;
+    
+    self = (CTriaxialEllipsoidModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CTriaxialEllipsoidModel_init(CTriaxialEllipsoidModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new TriaxialEllipsoidModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"axis_psi",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",57.325000000000));
+        PyDict_SetItemString(self->params,"semi_axisA",Py_BuildValue("d",35.000000000000));
+        PyDict_SetItemString(self->params,"semi_axisB",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"semi_axisC",Py_BuildValue("d",400.000000000000));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",57.325000000000));
+        PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000006300000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"sldEll",Py_BuildValue("d",0.000001000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->semi_axisA.dispersion->accept_as_source(visitor, self->model->semi_axisA.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "semi_axisA", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->semi_axisB.dispersion->accept_as_source(visitor, self->model->semi_axisB.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "semi_axisB", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->semi_axisC.dispersion->accept_as_source(visitor, self->model->semi_axisC.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "semi_axisC", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_theta.dispersion->accept_as_source(visitor, self->model->axis_theta.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_theta", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_phi.dispersion->accept_as_source(visitor, self->model->axis_phi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_phi", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->axis_psi.dispersion->accept_as_source(visitor, self->model->axis_psi.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "axis_psi", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CTriaxialEllipsoidModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CTriaxialEllipsoidModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CTriaxialEllipsoidModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CTriaxialEllipsoidModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CTriaxialEllipsoidModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(TriaxialEllipsoidModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( TriaxialEllipsoidModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CTriaxialEllipsoidModelError, 
+                   "CTriaxialEllipsoidModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CTriaxialEllipsoidModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_psi") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->semi_axisA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisA") );
+    self->model->semi_axisB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisB") );
+    self->model->semi_axisC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisC") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldEll = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldEll") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisA");
+    self->model->semi_axisA.dispersion->accept_as_destination(visitor, self->model->semi_axisA.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisB");
+    self->model->semi_axisB.dispersion->accept_as_destination(visitor, self->model->semi_axisB.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisC");
+    self->model->semi_axisC.dispersion->accept_as_destination(visitor, self->model->semi_axisC.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_psi");
+    self->model->axis_psi.dispersion->accept_as_destination(visitor, self->model->axis_psi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CTriaxialEllipsoidModelError, 
+	    	"CTriaxialEllipsoidModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CTriaxialEllipsoidModelError, 
+                   "CTriaxialEllipsoidModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CTriaxialEllipsoidModelError, 
+	    		"CTriaxialEllipsoidModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CTriaxialEllipsoidModelError, 
+                   "CTriaxialEllipsoidModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CTriaxialEllipsoidModelError, 
+                   "CTriaxialEllipsoidModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CTriaxialEllipsoidModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_psi") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->semi_axisA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisA") );
+    self->model->semi_axisB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisB") );
+    self->model->semi_axisC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisC") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldEll = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldEll") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisA");
+    self->model->semi_axisA.dispersion->accept_as_destination(visitor, self->model->semi_axisA.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisB");
+    self->model->semi_axisB.dispersion->accept_as_destination(visitor, self->model->semi_axisB.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisC");
+    self->model->semi_axisC.dispersion->accept_as_destination(visitor, self->model->semi_axisC.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_psi");
+    self->model->axis_psi.dispersion->accept_as_destination(visitor, self->model->axis_psi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CTriaxialEllipsoidModelError, 
+	    	"CTriaxialEllipsoidModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CTriaxialEllipsoidModelError, 
+	    		"CTriaxialEllipsoidModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CTriaxialEllipsoidModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CTriaxialEllipsoidModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CTriaxialEllipsoidModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CTriaxialEllipsoidModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_psi") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->semi_axisA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisA") );
+    self->model->semi_axisB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisB") );
+    self->model->semi_axisC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisC") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldEll = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldEll") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisA");
+    self->model->semi_axisA.dispersion->accept_as_destination(visitor, self->model->semi_axisA.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisB");
+    self->model->semi_axisB.dispersion->accept_as_destination(visitor, self->model->semi_axisB.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisC");
+    self->model->semi_axisC.dispersion->accept_as_destination(visitor, self->model->semi_axisC.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_psi");
+    self->model->axis_psi.dispersion->accept_as_destination(visitor, self->model->axis_psi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CTriaxialEllipsoidModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_psi") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->semi_axisA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisA") );
+    self->model->semi_axisB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisB") );
+    self->model->semi_axisC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisC") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldEll = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldEll") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisA");
+    self->model->semi_axisA.dispersion->accept_as_destination(visitor, self->model->semi_axisA.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisB");
+    self->model->semi_axisB.dispersion->accept_as_destination(visitor, self->model->semi_axisB.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisC");
+    self->model->semi_axisC.dispersion->accept_as_destination(visitor, self->model->semi_axisC.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_psi");
+    self->model->axis_psi.dispersion->accept_as_destination(visitor, self->model->axis_psi.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CTriaxialEllipsoidModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->axis_psi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_psi") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->semi_axisA = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisA") );
+    self->model->semi_axisB = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisB") );
+    self->model->semi_axisC = PyFloat_AsDouble( PyDict_GetItemString(self->params, "semi_axisC") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->sldSolv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldSolv") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->sldEll = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldEll") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisA");
+    self->model->semi_axisA.dispersion->accept_as_destination(visitor, self->model->semi_axisA.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisB");
+    self->model->semi_axisB.dispersion->accept_as_destination(visitor, self->model->semi_axisB.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "semi_axisC");
+    self->model->semi_axisC.dispersion->accept_as_destination(visitor, self->model->semi_axisC.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta");
+    self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi");
+    self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "axis_psi");
+    self->model->axis_psi.dispersion->accept_as_destination(visitor, self->model->axis_psi.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CTriaxialEllipsoidModelError, 
+	    	"CTriaxialEllipsoidModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CTriaxialEllipsoidModelError, 
+	    		"CTriaxialEllipsoidModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CTriaxialEllipsoidModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CTriaxialEllipsoidModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CTriaxialEllipsoidModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CTriaxialEllipsoidModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CTriaxialEllipsoidModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CTriaxialEllipsoidModelError,
+	    	"CTriaxialEllipsoidModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "semi_axisA")) {
+        self->model->semi_axisA.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "semi_axisB")) {
+        self->model->semi_axisB.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "semi_axisC")) {
+        self->model->semi_axisC.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_theta")) {
+        self->model->axis_theta.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_phi")) {
+        self->model->axis_phi.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "axis_psi")) {
+        self->model->axis_psi.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CTriaxialEllipsoidModelError,
+	    	"CTriaxialEllipsoidModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CTriaxialEllipsoidModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CTriaxialEllipsoidModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CTriaxialEllipsoidModel",             /*tp_name*/
+    sizeof(CTriaxialEllipsoidModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CTriaxialEllipsoidModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CTriaxialEllipsoidModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CTriaxialEllipsoidModel_methods,             /* tp_methods */
+    CTriaxialEllipsoidModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CTriaxialEllipsoidModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CTriaxialEllipsoidModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCTriaxialEllipsoidModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CTriaxialEllipsoidModelType) < 0)
+        return;
+
+    Py_INCREF(&CTriaxialEllipsoidModelType);
+    PyModule_AddObject(module, "CTriaxialEllipsoidModel", (PyObject *)&CTriaxialEllipsoidModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CTriaxialEllipsoidModel.error";
+    CTriaxialEllipsoidModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CTriaxialEllipsoidModelError", CTriaxialEllipsoidModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CTwoYukawaModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CTwoYukawaModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CTwoYukawaModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,555 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CTwoYukawaModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\TwoYukawa.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "TwoYukawa.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CTwoYukawaModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    TwoYukawaModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CTwoYukawaModel;
+
+
+static void
+CTwoYukawaModel_dealloc(CTwoYukawaModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CTwoYukawaModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CTwoYukawaModel *self;
+    
+    self = (CTwoYukawaModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CTwoYukawaModel_init(CTwoYukawaModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new TwoYukawaModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"decayConst_Z1",Py_BuildValue("d",10.000000000000));
+        PyDict_SetItemString(self->params,"decayConst_Z2",Py_BuildValue("d",2.000000000000));
+        PyDict_SetItemString(self->params,"volfraction",Py_BuildValue("d",0.200000000000));
+        PyDict_SetItemString(self->params,"effect_radius",Py_BuildValue("d",50.000000000000));
+        PyDict_SetItemString(self->params,"scale_K1",Py_BuildValue("d",6.000000000000));
+        PyDict_SetItemString(self->params,"scale_K2",Py_BuildValue("d",-1.000000000000));
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CTwoYukawaModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CTwoYukawaModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CTwoYukawaModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CTwoYukawaModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CTwoYukawaModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(TwoYukawaModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( TwoYukawaModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CTwoYukawaModelError, 
+                   "CTwoYukawaModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CTwoYukawaModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->decayConst_Z1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "decayConst_Z1") );
+    self->model->decayConst_Z2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "decayConst_Z2") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->scale_K1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale_K1") );
+    self->model->scale_K2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale_K2") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CTwoYukawaModelError, 
+	    	"CTwoYukawaModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CTwoYukawaModelError, 
+                   "CTwoYukawaModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CTwoYukawaModelError, 
+	    		"CTwoYukawaModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CTwoYukawaModelError, 
+                   "CTwoYukawaModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CTwoYukawaModelError, 
+                   "CTwoYukawaModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CTwoYukawaModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->decayConst_Z1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "decayConst_Z1") );
+    self->model->decayConst_Z2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "decayConst_Z2") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->scale_K1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale_K1") );
+    self->model->scale_K2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale_K2") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CTwoYukawaModelError, 
+	    	"CTwoYukawaModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CTwoYukawaModelError, 
+	    		"CTwoYukawaModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CTwoYukawaModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CTwoYukawaModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CTwoYukawaModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CTwoYukawaModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->decayConst_Z1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "decayConst_Z1") );
+    self->model->decayConst_Z2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "decayConst_Z2") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->scale_K1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale_K1") );
+    self->model->scale_K2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale_K2") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CTwoYukawaModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->decayConst_Z1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "decayConst_Z1") );
+    self->model->decayConst_Z2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "decayConst_Z2") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->scale_K1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale_K1") );
+    self->model->scale_K2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale_K2") );
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CTwoYukawaModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->decayConst_Z1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "decayConst_Z1") );
+    self->model->decayConst_Z2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "decayConst_Z2") );
+    self->model->volfraction = PyFloat_AsDouble( PyDict_GetItemString(self->params, "volfraction") );
+    self->model->effect_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "effect_radius") );
+    self->model->scale_K1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale_K1") );
+    self->model->scale_K2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale_K2") );
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CTwoYukawaModelError, 
+	    	"CTwoYukawaModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CTwoYukawaModelError, 
+	    		"CTwoYukawaModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CTwoYukawaModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CTwoYukawaModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CTwoYukawaModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CTwoYukawaModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CTwoYukawaModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CTwoYukawaModelError,
+	    	"CTwoYukawaModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+ {
+	    PyErr_SetString(CTwoYukawaModelError,
+	    	"CTwoYukawaModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CTwoYukawaModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CTwoYukawaModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CTwoYukawaModel",             /*tp_name*/
+    sizeof(CTwoYukawaModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CTwoYukawaModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CTwoYukawaModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CTwoYukawaModel_methods,             /* tp_methods */
+    CTwoYukawaModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CTwoYukawaModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CTwoYukawaModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCTwoYukawaModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CTwoYukawaModelType) < 0)
+        return;
+
+    Py_INCREF(&CTwoYukawaModelType);
+    PyModule_AddObject(module, "CTwoYukawaModel", (PyObject *)&CTwoYukawaModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CTwoYukawaModel.error";
+    CTwoYukawaModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CTwoYukawaModelError", CTwoYukawaModelError);
+}
+
Index: src/sans/models/c_extension/python_wrapper/generated/CVesicleModel.cpp
===================================================================
--- src/sans/models/c_extension/python_wrapper/generated/CVesicleModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ src/sans/models/c_extension/python_wrapper/generated/CVesicleModel.cpp	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,603 @@
+/**
+	This software was developed by the University of Tennessee as part of the
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+	project funded by the US National Science Foundation.
+
+	If you use DANSE applications to do scientific research that leads to
+	publication, we ask that you acknowledge the use of the software with the
+	following sentence:
+
+	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+
+	copyright 2008, University of Tennessee
+ */
+
+/** CVesicleModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY src\sans\models\include\vesicle.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+#define NO_IMPORT_ARRAY
+#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_sans
+ 
+extern "C" {
+#include <Python.h>
+#include <arrayobject.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+
+}
+
+#include "vesicle.h"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CVesicleModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    VesicleModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CVesicleModel;
+
+
+static void
+CVesicleModel_dealloc(CVesicleModel* self)
+{
+    Py_DECREF(self->params);
+    Py_DECREF(self->dispersion);
+    Py_DECREF(self->log);
+    delete self->model;
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CVesicleModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CVesicleModel *self;
+    
+    self = (CVesicleModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CVesicleModel_init(CVesicleModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+
+	self->model = new VesicleModel();
+
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"solv_sld",Py_BuildValue("d",0.000006360000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000));
+        PyDict_SetItemString(self->params,"thickness",Py_BuildValue("d",30.000000000000));
+        PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",100.000000000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000));
+        PyDict_SetItemString(self->params,"shell_sld",Py_BuildValue("d",0.000000500000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "radius", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->thickness.dispersion->accept_as_source(visitor, self->model->thickness.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "thickness", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static char name_params[] = "params";
+static char def_params[] = "Parameters";
+static char name_dispersion[] = "dispersion";
+static char def_dispersion[] = "Dispersion parameters";
+static char name_log[] = "log";
+static char def_log[] = "Log";
+
+static PyMemberDef CVesicleModel_members[] = {
+    {name_params, T_OBJECT, offsetof(CVesicleModel, params), 0, def_params},
+	{name_dispersion, T_OBJECT, offsetof(CVesicleModel, dispersion), 0, def_dispersion},     
+    {name_log, T_OBJECT, offsetof(CVesicleModel, log), 0, def_log},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CVesicleModel_readDouble(PyObject *p) {
+    if (PyFloat_Check(p)==1) {
+        return (double)(((PyFloatObject *)(p))->ob_fval);
+    } else if (PyInt_Check(p)==1) {
+        return (double)(((PyIntObject *)(p))->ob_ival);
+    } else if (PyLong_Check(p)==1) {
+        return (double)PyLong_AsLong(p);
+    } else {
+        return 0.0;
+    }
+}
+/**
+ * Function to call to evaluate model
+ * @param args: input numpy array q[] 
+ * @return: numpy array object 
+ */
+ 
+static PyObject *evaluateOneDim(VesicleModel* model, PyArrayObject *q){
+    PyArrayObject *result;
+   
+    // Check validity of array q , q must be of dimension 1, an array of double
+    if (q->nd != 1 || q->descr->type_num != PyArray_DOUBLE)
+    {
+        //const char * message= "Invalid array: q->nd=%d,type_num=%d\n",q->nd,q->descr->type_num;
+        //PyErr_SetString(PyExc_ValueError , message);
+        return NULL;
+    }
+    result = (PyArrayObject *)PyArray_FromDims(q->nd, (int *)(q->dimensions), PyArray_DOUBLE);
+	if (result == NULL) {
+        const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+		return NULL;
+	}
+#pragma omp parallel for
+	 for (int i = 0; i < q->dimensions[0]; i++){
+      double q_value  = *(double *)(q->data + i*q->strides[0]);
+      double *result_value = (double *)(result->data + i*result->strides[0]);
+      *result_value =(*model)(q_value);
+	}
+    return PyArray_Return(result); 
+ }
+
+ /**
+ * Function to call to evaluate model
+ * @param args: input numpy array  [x[],y[]]
+ * @return: numpy array object 
+ */
+ static PyObject * evaluateTwoDimXY( VesicleModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int x_len, y_len, dims[1];
+    //check validity of input vectors
+    if (x->nd != 1 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 1 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[0] != x->dimensions[0]){
+        const char * message= "evaluateTwoDimXY  expect 2 numpy arrays";
+        PyErr_SetString(PyExc_ValueError , message); 
+        return NULL;
+    }
+   
+	if (PyArray_Check(x) && PyArray_Check(y)) {
+		
+	    x_len = dims[0]= x->dimensions[0];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(1,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+#pragma omp parallel for
+        for (int i=0; i< x_len; i++) {
+            double x_value = *(double *)(x->data + i*x->strides[0]);
+  		    double y_value = *(double *)(y->data + i*y->strides[0]);
+  			double *result_value = (double *)(result->data +
+  			      i*result->strides[0]);
+  			*result_value = (*model)(x_value, y_value);
+        }           
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CVesicleModelError, 
+                   "CVesicleModel.evaluateTwoDimXY couldn't run.");
+	        return NULL;
+		}      	
+}
+/**
+ *  evalDistribution function evaluate a model function with input vector
+ *  @param args: input q as vector or [qx, qy] where qx, qy are vectors
+ *
+ */ 
+static PyObject * evalDistribution(CVesicleModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->solv_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solv_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CVesicleModelError, 
+	    	"CVesicleModel.evalDistribution expects a q value.");
+		return NULL;
+	}
+    // Check params
+	
+    if(PyArray_Check(pars)==1) {
+		
+	    // Length of list should 1 or 2
+	    npars = pars->nd; 
+	    if(npars==1) {
+	        // input is a numpy array
+	        if (PyArray_Check(pars)) {
+		        return evaluateOneDim(self->model, (PyArrayObject*)pars); 
+		    }
+		}else{
+		    PyErr_SetString(CVesicleModelError, 
+                   "CVesicleModel.evalDistribution expect numpy array of one dimension.");
+	        return NULL;
+		}
+    }else if( PyList_Check(pars)==1) {
+    	// Length of list should be 2 for I(qx,qy)
+	    mpars = PyList_GET_SIZE(pars); 
+	    if(mpars!=2) {
+	    	PyErr_SetString(CVesicleModelError, 
+	    		"CVesicleModel.evalDistribution expects a list of dimension 2.");
+	    	return NULL;
+	    }
+	     qx = PyList_GET_ITEM(pars,0);
+	     qy = PyList_GET_ITEM(pars,1);
+	     if (PyArray_Check(qx) && PyArray_Check(qy)) {
+	         return evaluateTwoDimXY(self->model, (PyArrayObject*)qx,
+		           (PyArrayObject*)qy);
+		 }else{
+		    PyErr_SetString(CVesicleModelError, 
+                   "CVesicleModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CVesicleModelError, 
+                   "CVesicleModel.evalDistribution couln't be run.");
+	return NULL;
+	
+}
+
+/**
+ * Function to call to evaluate model
+ * @param args: input q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CVesicleModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->solv_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solv_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CVesicleModelError, 
+	    	"CVesicleModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(q,phi)
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CVesicleModelError, 
+	    		"CVesicleModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the q and phi values at which
+	    // to evaluate I(q,phi)
+	    q_value = CVesicleModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CVesicleModel_readDouble(PyList_GET_ITEM(pars,1));
+	    // Skip zero
+	    if (q_value==0) {
+	    	return Py_BuildValue("d",0.0);
+	    }
+		return Py_BuildValue("d",(*(self->model)).evaluate_rphi(q_value,phi_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		q_value = CVesicleModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CVesicleModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->solv_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solv_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to cal the ratio shell volume/ total volume
+ * @return: the ratio shell volume/ total volume 
+ */
+static PyObject * calculate_VR(CVesicleModel *self) {
+
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->solv_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solv_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_VR());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CVesicleModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->solv_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solv_sld") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") );
+    self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "radius");
+    self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "thickness");
+    self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict);
+
+	
+	// Get input and determine whether we have to supply a 1D or 2D return value.
+	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
+	    PyErr_SetString(CVesicleModelError, 
+	    	"CVesicleModel.run expects a q value.");
+		return NULL;
+	}
+	  
+	// Check params
+	if( PyList_Check(pars)==1) {
+		
+		// Length of list should be 2 for I(qx, qy))
+	    npars = PyList_GET_SIZE(pars); 
+	    if(npars!=2) {
+	    	PyErr_SetString(CVesicleModelError, 
+	    		"CVesicleModel.run expects a double or a list of dimension 2.");
+	    	return NULL;
+	    }
+	    // We have a vector q, get the qx and qy values at which
+	    // to evaluate I(qx,qy)
+	    qx_value = CVesicleModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CVesicleModel_readDouble(PyList_GET_ITEM(pars,1));
+	    return Py_BuildValue("d",(*(self->model))(qx_value,qy_value));
+
+	} else {
+
+		// We have a scalar q, we will evaluate I(q)
+		qx_value = CVesicleModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CVesicleModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CVesicleModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CVesicleModelError,
+	    	"CVesicleModel.set_dispersion expects a DispersionModel object.");
+		return NULL;
+	}
+	void *temp = PyCObject_AsVoidPtr(disp);
+	DispersionModel * dispersion = static_cast<DispersionModel *>(temp);
+
+
+	// Ugliness necessary to go from python to C
+	    // TODO: refactor this
+    if (!strcmp(par_name, "radius")) {
+        self->model->radius.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "thickness")) {
+        self->model->thickness.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CVesicleModelError,
+	    	"CVesicleModel.set_dispersion expects a valid parameter name.");
+		return NULL;
+	}
+
+	DispersionVisitor* visitor = new DispersionVisitor();
+	PyObject * disp_dict = PyDict_New();
+	dispersion->accept_as_source(visitor, dispersion, disp_dict);
+	PyDict_SetItemString(self->dispersion, par_name, disp_dict);
+    return Py_BuildValue("i",1);
+}
+
+
+static PyMethodDef CVesicleModel_methods[] = {
+    {"run",      (PyCFunction)run     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"runXY",      (PyCFunction)runXY     , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy"},
+    {"calculate_ER",      (PyCFunction)calculate_ER     , METH_VARARGS,
+      "Evaluate the model at a given Q or Q, phi"},
+    {"calculate_VR",      (PyCFunction)calculate_VR     , METH_VARARGS,
+      "Evaluate VR"},    
+    {"evalDistribution",  (PyCFunction)evalDistribution , METH_VARARGS,
+      "Evaluate the model at a given Q or Qx, Qy vector "},
+    {"reset",    (PyCFunction)reset   , METH_VARARGS,
+      "Reset pair correlation"},
+    {"set_dispersion",      (PyCFunction)set_dispersion     , METH_VARARGS,
+      "Set the dispersion model for a given parameter"},
+   {NULL}
+};
+
+static PyTypeObject CVesicleModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CVesicleModel",             /*tp_name*/
+    sizeof(CVesicleModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CVesicleModel_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CVesicleModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CVesicleModel_methods,             /* tp_methods */
+    CVesicleModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CVesicleModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CVesicleModel_new,                 /* tp_new */
+};
+
+
+//static PyMethodDef module_methods[] = {
+//    {NULL} 
+//};
+
+/**
+ * Function used to add the model class to a module
+ * @param module: module to add the class to
+ */ 
+void addCVesicleModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CVesicleModelType) < 0)
+        return;
+
+    Py_INCREF(&CVesicleModelType);
+    PyModule_AddObject(module, "CVesicleModel", (PyObject *)&CVesicleModelType);
+    
+    d = PyModule_GetDict(module);
+    static char error_name[] = "CVesicleModel.error";
+    CVesicleModelError = PyErr_NewException(error_name, NULL, NULL);
+    PyDict_SetItemString(d, "CVesicleModelError", CVesicleModelError);
+}
+
Index: src/sas/dataloader/manipulations.py
===================================================================
--- src/sas/dataloader/manipulations.py	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/dataloader/manipulations.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -582,5 +582,5 @@
     """
     #Todo: remove center.
-    def __init__(self, r_min=0, r_max=0, center_x=0, center_y=0, nbins=20):
+    def __init__(self, r_min=0, r_max=0, center_x=0, center_y=0, nbins=36):
         # Minimum radius
         self.r_min = r_min
@@ -593,4 +593,5 @@
         # Number of angular bins
         self.nbins_phi = nbins
+
         
     def __call__(self, data2D):
@@ -622,5 +623,8 @@
         phi_values = numpy.zeros(self.nbins_phi)
         phi_err    = numpy.zeros(self.nbins_phi)
-        
+	
+	# Shift to apply to calculated phi values in order to center first bin at zero
+	phi_shift = Pi / self.nbins_phi
+
         for npt in range(len(data)):
             frac = 0
@@ -637,9 +641,9 @@
                 continue
             # binning           
-            i_phi = int(math.floor((self.nbins_phi) * phi_value / (2 * Pi)))
+            i_phi = int(math.floor((self.nbins_phi) * (phi_value+phi_shift) / (2 * Pi)))
             
             # Take care of the edge case at phi = 2pi.
-            if i_phi == self.nbins_phi:
-                i_phi =  self.nbins_phi - 1
+            if i_phi >= self.nbins_phi:
+                i_phi =  0
             phi_bins[i_phi] += frac * data[npt]
             
@@ -655,5 +659,5 @@
             phi_bins[i] = phi_bins[i] / phi_counts[i]
             phi_err[i] = math.sqrt(phi_err[i]) / phi_counts[i]
-            phi_values[i] = 2.0 * math.pi / self.nbins_phi * (1.0 * i + 0.5)
+            phi_values[i] = 2.0 * math.pi / self.nbins_phi * (1.0 * i)
             
         idx = (numpy.isfinite(phi_bins))
Index: src/sas/guiframe/local_perspectives/plotting/AnnulusSlicer.py
===================================================================
--- src/sas/guiframe/local_perspectives/plotting/AnnulusSlicer.py	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/guiframe/local_perspectives/plotting/AnnulusSlicer.py	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -35,5 +35,5 @@
     
         ## Number of points on the plot
-        self.nbins = 20
+        self.nbins = 36
         #Cursor position of Rings (Left(-1) or Right(1))
         self.xmaxd = self.base.data2D.xmax
@@ -131,7 +131,7 @@
                    math.fabs(self.outer_circle.get_radius()))
         #if the user does not specify the numbers of points to plot 
-        # the default number will be nbins= 20
+        # the default number will be nbins= 36
         if nbins == None:
-            self.nbins = 20
+            self.nbins = 36
         else:
             self.nbins = nbins
Index: test/pr_inversion/test/test_output.txt
===================================================================
--- test/pr_inversion/test/test_output.txt	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ test/pr_inversion/test/test_output.txt	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,123 @@
+#d_max=160
+#nfunc=10
+#alpha=0.0007
+#chi2=836.797
+#elapsed=0
+#qmin=None
+#qmax=None
+#slit_height=0
+#slit_width=0
+#background=0
+#has_bck=0
+#alpha_estimate=4.58991e-06
+#C_0=217.876478953+-2522.42314999
+#C_1=0.30164617344+-226.644556603
+#C_2=7.15694574584+-43.4919208221
+#C_3=-0.79690812244+-25.8031634616
+#C_4=0.948333847403+-11.3794625443
+#C_5=-0.751612279429+-8.64083336005
+#C_6=-0.0796650783501+-5.73820483268
+#C_7=-0.518109559543+-3.56660274557
+#C_8=-0.129910831984+-1.99841316045
+#C_9=-0.258134624641+-0.756509301101
+<r>  <Pr>  <dPr>
+0  0  0
+1.6  22.981  7.48836
+3.2  91.986  29.737
+4.8  207.187  66.1302
+6.4  368.819  115.749
+8  577.117  177.508
+9.6  832.224  250.315
+11.2  1134.11  333.205
+12.8  1482.46  425.442
+14.4  1876.63  526.549
+16  2315.57  636.272
+17.6  2797.81  754.499
+19.2  3321.46  881.145
+20.8  3884.25  1016.06
+22.4  4483.6  1158.97
+24  5116.72  1309.47
+25.6  5780.7  1467.05
+27.2  6472.66  1631.18
+28.8  7189.82  1801.33
+30.4  7929.59  1977.02
+32  8689.7  2157.88
+33.6  9468.17  2343.55
+35.2  10263.4  2533.72
+36.8  11073.9  2728.06
+38.4  11898.7  2926.2
+40  12737  3127.75
+41.6  13587.7  3332.27
+43.2  14450.2  3539.34
+44.8  15323.5  3748.54
+46.4  16206.5  3959.49
+48  17098  4171.83
+49.6  17996.3  4385.18
+51.2  18899.8  4599.19
+52.8  19806.5  4813.46
+54.4  20714.3  5027.56
+56  21620.8  5241.07
+57.6  22524  5453.53
+59.2  23421.6  5664.53
+60.8  24311.7  5873.68
+62.4  25192.3  6080.65
+64  26061.8  6285.13
+65.6  26918.7  6486.85
+67.2  27761.7  6685.53
+68.8  28589.6  6880.91
+70.4  29401.3  7072.73
+72  30195.6  7260.72
+73.6  30971.4  7444.63
+75.2  31727.2  7624.23
+76.8  32461.5  7799.3
+78.4  33172.7  7969.61
+80  33858.8  8134.91
+81.6  34517.8  8294.9
+83.2  35147.6  8449.24
+84.8  35745.9  8597.54
+86.4  36310.5  8739.34
+88  36839.5  8874.2
+89.6  37330.9  9001.64
+91.2  37783.1  9121.2
+92.8  38194.6  9232.39
+94.4  38564.3  9334.72
+96  38891.1  9427.68
+97.6  39174.1  9510.74
+99.2  39412.6  9583.35
+100.8  39605.8  9644.98
+102.4  39752.6  9695.14
+104  39851.9  9733.38
+105.6  39902.4  9759.36
+107.2  39902.5  9772.74
+108.8  39850.1  9773.24
+110.4  39743.2  9760.52
+112  39579.6  9734.22
+113.6  39356.7  9693.89
+115.2  39072.3  9639.07
+116.8  38724.1  9569.28
+118.4  38310.3  9484.1
+120  37829  9383.18
+121.6  37278.9  9266.24
+123.2  36659  9133
+124.8  35968.4  8983.13
+126.4  35206.6  8816.15
+128  34373  8631.45
+129.6  33466.9  8428.29
+131.2  32487.5  8205.96
+132.8  31433.4  7963.92
+134.4  30303.1  7701.95
+136  29094.1  7420.23
+137.6  27803.8  7119.29
+139.2  26428.9  6799.69
+140.8  24965.9  6461.63
+142.4  23411.1  6104.48
+144  21761.3  5726.35
+145.6  20013.4  5323.88
+147.2  18165.4  4892.46
+148.8  16216.4  4426.74
+150.4  14166.9  3921.46
+152  12019  3372.52
+153.6  9776.61  2777.82
+155.2  7445.34  2138.05
+156.8  5032.57  1456.94
+158.4  2547.22  741.175
Index: test/sasdataloader/test/isis_1_0_write_test.xml
===================================================================
--- test/sasdataloader/test/isis_1_0_write_test.xml	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ test/sasdataloader/test/isis_1_0_write_test.xml	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,865 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?xml-stylesheet type="text/xsl" href="cansasxml-html.xsl" ?>
+<SASroot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="cansas1d/1.0" version="1.0" xsi:schemaLocation="cansas1d/1.0 http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd">
+  <SASentry>
+    <Title>TK49 c10_SANS</Title>
+    <Run>79680</Run>
+    <SASdata>
+      <Idata>
+        <Q unit="1/A">0.009</Q>
+        <I unit="1/cm">85.3333</I>
+        <Idev unit="1/cm">0.852491</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.011</Q>
+        <I unit="1/cm">72.5398</I>
+        <Idev unit="1/cm">0.639548</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.013</Q>
+        <I unit="1/cm">63.3582</I>
+        <Idev unit="1/cm">0.494127</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.015</Q>
+        <I unit="1/cm">57.0952</I>
+        <Idev unit="1/cm">0.414116</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.017</Q>
+        <I unit="1/cm">51.0139</I>
+        <Idev unit="1/cm">0.35145</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.019</Q>
+        <I unit="1/cm">46.4746</I>
+        <Idev unit="1/cm">0.308755</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.021</Q>
+        <I unit="1/cm">41.7191</I>
+        <Idev unit="1/cm">0.271641</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.023</Q>
+        <I unit="1/cm">37.4208</I>
+        <Idev unit="1/cm">0.244658</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.025</Q>
+        <I unit="1/cm">33.7352</I>
+        <Idev unit="1/cm">0.219594</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.027</Q>
+        <I unit="1/cm">30.6073</I>
+        <Idev unit="1/cm">0.203138</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.029</Q>
+        <I unit="1/cm">27.7309</I>
+        <Idev unit="1/cm">0.185859</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.031</Q>
+        <I unit="1/cm">25.2579</I>
+        <Idev unit="1/cm">0.171356</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.033</Q>
+        <I unit="1/cm">22.7712</I>
+        <Idev unit="1/cm">0.159062</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.035</Q>
+        <I unit="1/cm">20.5323</I>
+        <Idev unit="1/cm">0.146135</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.037</Q>
+        <I unit="1/cm">19.0744</I>
+        <Idev unit="1/cm">0.136393</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.039</Q>
+        <I unit="1/cm">17.2832</I>
+        <Idev unit="1/cm">0.127623</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.041</Q>
+        <I unit="1/cm">15.7399</I>
+        <Idev unit="1/cm">0.118288</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.043</Q>
+        <I unit="1/cm">14.5598</I>
+        <Idev unit="1/cm">0.111759</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.045</Q>
+        <I unit="1/cm">13.5906</I>
+        <Idev unit="1/cm">0.105148</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.047</Q>
+        <I unit="1/cm">12.6707</I>
+        <Idev unit="1/cm">0.0996579</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.049</Q>
+        <I unit="1/cm">11.5247</I>
+        <Idev unit="1/cm">0.0929646</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.051</Q>
+        <I unit="1/cm">10.7089</I>
+        <Idev unit="1/cm">0.0888575</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.053</Q>
+        <I unit="1/cm">10.1436</I>
+        <Idev unit="1/cm">0.0849394</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.055</Q>
+        <I unit="1/cm">9.49446</I>
+        <Idev unit="1/cm">0.0811205</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.057</Q>
+        <I unit="1/cm">8.80775</I>
+        <Idev unit="1/cm">0.0773967</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.059</Q>
+        <I unit="1/cm">8.33366</I>
+        <Idev unit="1/cm">0.0748147</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.061</Q>
+        <I unit="1/cm">7.79157</I>
+        <Idev unit="1/cm">0.0720107</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.063</Q>
+        <I unit="1/cm">7.25902</I>
+        <Idev unit="1/cm">0.0693582</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.065</Q>
+        <I unit="1/cm">7.04789</I>
+        <Idev unit="1/cm">0.0677591</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.067</Q>
+        <I unit="1/cm">6.53311</I>
+        <Idev unit="1/cm">0.0652207</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.069</Q>
+        <I unit="1/cm">6.2453</I>
+        <Idev unit="1/cm">0.0642016</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.071</Q>
+        <I unit="1/cm">5.94152</I>
+        <Idev unit="1/cm">0.0625768</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.073</Q>
+        <I unit="1/cm">5.70816</I>
+        <Idev unit="1/cm">0.0612955</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.075</Q>
+        <I unit="1/cm">5.24449</I>
+        <Idev unit="1/cm">0.060141</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.077</Q>
+        <I unit="1/cm">5.08291</I>
+        <Idev unit="1/cm">0.0582239</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.079</Q>
+        <I unit="1/cm">4.88135</I>
+        <Idev unit="1/cm">0.057969</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.081</Q>
+        <I unit="1/cm">4.60942</I>
+        <Idev unit="1/cm">0.056813</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.083</Q>
+        <I unit="1/cm">4.46606</I>
+        <Idev unit="1/cm">0.0569381</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.085</Q>
+        <I unit="1/cm">4.32473</I>
+        <Idev unit="1/cm">0.0558766</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.087</Q>
+        <I unit="1/cm">4.14144</I>
+        <Idev unit="1/cm">0.0552525</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.089</Q>
+        <I unit="1/cm">3.86504</I>
+        <Idev unit="1/cm">0.0544569</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.091</Q>
+        <I unit="1/cm">3.74272</I>
+        <Idev unit="1/cm">0.0529596</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.093</Q>
+        <I unit="1/cm">3.68281</I>
+        <Idev unit="1/cm">0.052891</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.095</Q>
+        <I unit="1/cm">3.46991</I>
+        <Idev unit="1/cm">0.0517565</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.097</Q>
+        <I unit="1/cm">3.37244</I>
+        <Idev unit="1/cm">0.0509328</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.099</Q>
+        <I unit="1/cm">3.27074</I>
+        <Idev unit="1/cm">0.0505183</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.101</Q>
+        <I unit="1/cm">3.13326</I>
+        <Idev unit="1/cm">0.0490847</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.103</Q>
+        <I unit="1/cm">3.01387</I>
+        <Idev unit="1/cm">0.0487012</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.105</Q>
+        <I unit="1/cm">2.87628</I>
+        <Idev unit="1/cm">0.0484307</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.107</Q>
+        <I unit="1/cm">2.85043</I>
+        <Idev unit="1/cm">0.0476786</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.109</Q>
+        <I unit="1/cm">2.72799</I>
+        <Idev unit="1/cm">0.0475526</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.111</Q>
+        <I unit="1/cm">2.61206</I>
+        <Idev unit="1/cm">0.0467475</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.113</Q>
+        <I unit="1/cm">2.58895</I>
+        <Idev unit="1/cm">0.0469767</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.115</Q>
+        <I unit="1/cm">2.45987</I>
+        <Idev unit="1/cm">0.0460139</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.117</Q>
+        <I unit="1/cm">2.37723</I>
+        <Idev unit="1/cm">0.045272</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.119</Q>
+        <I unit="1/cm">2.34122</I>
+        <Idev unit="1/cm">0.0453741</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.121</Q>
+        <I unit="1/cm">2.21745</I>
+        <Idev unit="1/cm">0.0444485</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.123</Q>
+        <I unit="1/cm">2.12646</I>
+        <Idev unit="1/cm">0.0438385</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.125</Q>
+        <I unit="1/cm">2.11264</I>
+        <Idev unit="1/cm">0.0441662</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.127</Q>
+        <I unit="1/cm">2.07523</I>
+        <Idev unit="1/cm">0.0438979</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.129</Q>
+        <I unit="1/cm">2.03548</I>
+        <Idev unit="1/cm">0.0442422</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.131</Q>
+        <I unit="1/cm">1.92452</I>
+        <Idev unit="1/cm">0.0435959</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.133</Q>
+        <I unit="1/cm">1.90866</I>
+        <Idev unit="1/cm">0.0437401</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.135</Q>
+        <I unit="1/cm">1.91252</I>
+        <Idev unit="1/cm">0.0443163</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.137</Q>
+        <I unit="1/cm">1.80405</I>
+        <Idev unit="1/cm">0.043466</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.139</Q>
+        <I unit="1/cm">1.72166</I>
+        <Idev unit="1/cm">0.0429246</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.141</Q>
+        <I unit="1/cm">1.67199</I>
+        <Idev unit="1/cm">0.042469</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.143</Q>
+        <I unit="1/cm">1.63282</I>
+        <Idev unit="1/cm">0.0430074</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.145</Q>
+        <I unit="1/cm">1.63712</I>
+        <Idev unit="1/cm">0.0438557</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.147</Q>
+        <I unit="1/cm">1.5862</I>
+        <Idev unit="1/cm">0.0434135</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.149</Q>
+        <I unit="1/cm">1.56121</I>
+        <Idev unit="1/cm">0.0432591</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.151</Q>
+        <I unit="1/cm">1.49764</I>
+        <Idev unit="1/cm">0.0426577</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.153</Q>
+        <I unit="1/cm">1.53828</I>
+        <Idev unit="1/cm">0.0446481</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.155</Q>
+        <I unit="1/cm">1.47366</I>
+        <Idev unit="1/cm">0.0441973</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.157</Q>
+        <I unit="1/cm">1.40582</I>
+        <Idev unit="1/cm">0.0430461</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.159</Q>
+        <I unit="1/cm">1.40491</I>
+        <Idev unit="1/cm">0.0439883</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.161</Q>
+        <I unit="1/cm">1.34639</I>
+        <Idev unit="1/cm">0.044193</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.163</Q>
+        <I unit="1/cm">1.32238</I>
+        <Idev unit="1/cm">0.0438008</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.165</Q>
+        <I unit="1/cm">1.33885</I>
+        <Idev unit="1/cm">0.0445383</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.167</Q>
+        <I unit="1/cm">1.29608</I>
+        <Idev unit="1/cm">0.0451575</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.169</Q>
+        <I unit="1/cm">1.30562</I>
+        <Idev unit="1/cm">0.0460656</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.171</Q>
+        <I unit="1/cm">1.17147</I>
+        <Idev unit="1/cm">0.0435717</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.173</Q>
+        <I unit="1/cm">1.18565</I>
+        <Idev unit="1/cm">0.0449072</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.175</Q>
+        <I unit="1/cm">1.18944</I>
+        <Idev unit="1/cm">0.0465319</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.177</Q>
+        <I unit="1/cm">1.17055</I>
+        <Idev unit="1/cm">0.0456562</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.179</Q>
+        <I unit="1/cm">1.08571</I>
+        <Idev unit="1/cm">0.0453852</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.181</Q>
+        <I unit="1/cm">1.06208</I>
+        <Idev unit="1/cm">0.0463335</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.183</Q>
+        <I unit="1/cm">1.06187</I>
+        <Idev unit="1/cm">0.0458284</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.185</Q>
+        <I unit="1/cm">1.02727</I>
+        <Idev unit="1/cm">0.0472613</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.187</Q>
+        <I unit="1/cm">0.995169</I>
+        <Idev unit="1/cm">0.0465526</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.189</Q>
+        <I unit="1/cm">1.02569</I>
+        <Idev unit="1/cm">0.0483728</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.191</Q>
+        <I unit="1/cm">0.981154</I>
+        <Idev unit="1/cm">0.0490559</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.193</Q>
+        <I unit="1/cm">1.01831</I>
+        <Idev unit="1/cm">0.0502348</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.195</Q>
+        <I unit="1/cm">0.968102</I>
+        <Idev unit="1/cm">0.0504426</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.197</Q>
+        <I unit="1/cm">0.940656</I>
+        <Idev unit="1/cm">0.0512734</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.199</Q>
+        <I unit="1/cm">1.05762</I>
+        <Idev unit="1/cm">0.0547469</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.201</Q>
+        <I unit="1/cm">0.949872</I>
+        <Idev unit="1/cm">0.055229</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.203</Q>
+        <I unit="1/cm">0.891716</I>
+        <Idev unit="1/cm">0.0531346</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.205</Q>
+        <I unit="1/cm">0.876084</I>
+        <Idev unit="1/cm">0.0548681</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.207</Q>
+        <I unit="1/cm">0.932101</I>
+        <Idev unit="1/cm">0.0576812</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.209</Q>
+        <I unit="1/cm">0.927755</I>
+        <Idev unit="1/cm">0.0593404</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.211</Q>
+        <I unit="1/cm">0.87669</I>
+        <Idev unit="1/cm">0.0600369</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.213</Q>
+        <I unit="1/cm">0.809125</I>
+        <Idev unit="1/cm">0.0588107</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.215</Q>
+        <I unit="1/cm">0.941202</I>
+        <Idev unit="1/cm">0.0659121</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.217</Q>
+        <I unit="1/cm">0.946175</I>
+        <Idev unit="1/cm">0.0690784</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.219</Q>
+        <I unit="1/cm">0.859875</I>
+        <Idev unit="1/cm">0.0674435</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.221</Q>
+        <I unit="1/cm">0.959508</I>
+        <Idev unit="1/cm">0.0718856</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.223</Q>
+        <I unit="1/cm">0.763222</I>
+        <Idev unit="1/cm">0.0702866</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.225</Q>
+        <I unit="1/cm">0.785467</I>
+        <Idev unit="1/cm">0.0742144</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.227</Q>
+        <I unit="1/cm">0.81876</I>
+        <Idev unit="1/cm">0.074266</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.229</Q>
+        <I unit="1/cm">0.678311</I>
+        <Idev unit="1/cm">0.0722578</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.231</Q>
+        <I unit="1/cm">0.761442</I>
+        <Idev unit="1/cm">0.0814516</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.233</Q>
+        <I unit="1/cm">0.757076</I>
+        <Idev unit="1/cm">0.0825262</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.235</Q>
+        <I unit="1/cm">0.600636</I>
+        <Idev unit="1/cm">0.075041</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.237</Q>
+        <I unit="1/cm">0.685635</I>
+        <Idev unit="1/cm">0.0842392</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.239</Q>
+        <I unit="1/cm">0.799186</I>
+        <Idev unit="1/cm">0.0974365</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.241</Q>
+        <I unit="1/cm">0.737526</I>
+        <Idev unit="1/cm">0.0957286</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.243</Q>
+        <I unit="1/cm">0.716415</I>
+        <Idev unit="1/cm">0.0970448</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.245</Q>
+        <I unit="1/cm">0.720413</I>
+        <Idev unit="1/cm">0.0981996</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.247</Q>
+        <I unit="1/cm">0.604059</I>
+        <Idev unit="1/cm">0.100869</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.249</Q>
+        <I unit="1/cm">0.649073</I>
+        <Idev unit="1/cm">0.109281</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.251</Q>
+        <I unit="1/cm">0.700691</I>
+        <Idev unit="1/cm">0.114325</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.253</Q>
+        <I unit="1/cm">0.586789</I>
+        <Idev unit="1/cm">0.108324</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.255</Q>
+        <I unit="1/cm">0.765838</I>
+        <Idev unit="1/cm">0.139579</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.257</Q>
+        <I unit="1/cm">0.828968</I>
+        <Idev unit="1/cm">0.156723</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.259</Q>
+        <I unit="1/cm">0.616499</I>
+        <Idev unit="1/cm">0.137866</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.261</Q>
+        <I unit="1/cm">0.526011</I>
+        <Idev unit="1/cm">0.126209</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.263</Q>
+        <I unit="1/cm">0.51277</I>
+        <Idev unit="1/cm">0.126339</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.265</Q>
+        <I unit="1/cm">0.604189</I>
+        <Idev unit="1/cm">0.166393</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.267</Q>
+        <I unit="1/cm">0.738765</I>
+        <Idev unit="1/cm">0.194006</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.269</Q>
+        <I unit="1/cm">0.462803</I>
+        <Idev unit="1/cm">0.155354</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.271</Q>
+        <I unit="1/cm">0.478694</I>
+        <Idev unit="1/cm">0.171676</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.273</Q>
+        <I unit="1/cm">0.711983</I>
+        <Idev unit="1/cm">0.255539</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.275</Q>
+        <I unit="1/cm">0.473304</I>
+        <Idev unit="1/cm">0.230752</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.277</Q>
+        <I unit="1/cm">0.536817</I>
+        <Idev unit="1/cm">0.262627</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.279</Q>
+        <I unit="1/cm">0.660654</I>
+        <Idev unit="1/cm">0.297519</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.281</Q>
+        <I unit="1/cm">0.408902</I>
+        <Idev unit="1/cm">0.24585</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.283</Q>
+        <I unit="1/cm">0.0</I>
+        <Idev unit="1/cm">0.0</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+    </SASdata>
+    <SASsample name="">
+      <ID>TK49 c10_SANS</ID>
+    </SASsample>
+    <SASinstrument>
+      <name>LOQ</name>
+      <SASsource>
+        <radiation>neutron</radiation>
+      </SASsource>
+      <SAScollimation/>
+      <SASdetector>
+        <name>HAB</name>
+        <SDD unit="mm">575.0</SDD>
+      </SASdetector>
+      <SASdetector>
+        <name>main-detector-bank</name>
+        <SDD unit="mm">4145.02</SDD>
+      </SASdetector>
+    </SASinstrument>
+    <SASprocess>
+      <name>Mantid generated CanSAS1D XML</name>
+      <date>02-Aug-2013 16:54:14</date>
+      <description></description>
+      <term name="svn">2.5.3</term>
+      <term name="user_file">K:/masks/MASKLOQ_MAN_132E_Lu_Banjo_12mm.txt</term>
+      <SASprocessnote></SASprocessnote>
+    </SASprocess>
+    <SASnote></SASnote>
+  </SASentry>
+</SASroot>
Index: test/sasdataloader/test/isis_1_1_write_test.xml
===================================================================
--- test/sasdataloader/test/isis_1_1_write_test.xml	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ test/sasdataloader/test/isis_1_1_write_test.xml	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,1557 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?xml-stylesheet type="text/xsl" href="cansas1d.xsl" ?>
+<SASroot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:cansas1d:1.1" version="1.1" xsi:schemaLocation="urn:cansas1d:1.1 http://www.cansas.org/formats/1.1/cansas1d.xsd">
+  <SASentry>
+    <Title>TK49 c10_SANS</Title>
+    <Run>79680</Run>
+    <SASdata>
+      <Idata>
+        <Q unit="1/A">0.009</Q>
+        <I unit="1/cm">85.3333</I>
+        <Idev unit="1/cm">0.852491</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.011</Q>
+        <I unit="1/cm">72.5398</I>
+        <Idev unit="1/cm">0.639548</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.013</Q>
+        <I unit="1/cm">63.3582</I>
+        <Idev unit="1/cm">0.494127</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.015</Q>
+        <I unit="1/cm">57.0952</I>
+        <Idev unit="1/cm">0.414116</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.017</Q>
+        <I unit="1/cm">51.0139</I>
+        <Idev unit="1/cm">0.35145</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.019</Q>
+        <I unit="1/cm">46.4746</I>
+        <Idev unit="1/cm">0.308755</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.021</Q>
+        <I unit="1/cm">41.7191</I>
+        <Idev unit="1/cm">0.271641</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.023</Q>
+        <I unit="1/cm">37.4208</I>
+        <Idev unit="1/cm">0.244658</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.025</Q>
+        <I unit="1/cm">33.7352</I>
+        <Idev unit="1/cm">0.219594</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.027</Q>
+        <I unit="1/cm">30.6073</I>
+        <Idev unit="1/cm">0.203138</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.029</Q>
+        <I unit="1/cm">27.7309</I>
+        <Idev unit="1/cm">0.185859</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.031</Q>
+        <I unit="1/cm">25.2579</I>
+        <Idev unit="1/cm">0.171356</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.033</Q>
+        <I unit="1/cm">22.7712</I>
+        <Idev unit="1/cm">0.159062</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.035</Q>
+        <I unit="1/cm">20.5323</I>
+        <Idev unit="1/cm">0.146135</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.037</Q>
+        <I unit="1/cm">19.0744</I>
+        <Idev unit="1/cm">0.136393</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.039</Q>
+        <I unit="1/cm">17.2832</I>
+        <Idev unit="1/cm">0.127623</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.041</Q>
+        <I unit="1/cm">15.7399</I>
+        <Idev unit="1/cm">0.118288</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.043</Q>
+        <I unit="1/cm">14.5598</I>
+        <Idev unit="1/cm">0.111759</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.045</Q>
+        <I unit="1/cm">13.5906</I>
+        <Idev unit="1/cm">0.105148</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.047</Q>
+        <I unit="1/cm">12.6707</I>
+        <Idev unit="1/cm">0.0996579</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.049</Q>
+        <I unit="1/cm">11.5247</I>
+        <Idev unit="1/cm">0.0929646</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.051</Q>
+        <I unit="1/cm">10.7089</I>
+        <Idev unit="1/cm">0.0888575</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.053</Q>
+        <I unit="1/cm">10.1436</I>
+        <Idev unit="1/cm">0.0849394</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.055</Q>
+        <I unit="1/cm">9.49446</I>
+        <Idev unit="1/cm">0.0811205</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.057</Q>
+        <I unit="1/cm">8.80775</I>
+        <Idev unit="1/cm">0.0773967</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.059</Q>
+        <I unit="1/cm">8.33366</I>
+        <Idev unit="1/cm">0.0748147</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.061</Q>
+        <I unit="1/cm">7.79157</I>
+        <Idev unit="1/cm">0.0720107</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.063</Q>
+        <I unit="1/cm">7.25902</I>
+        <Idev unit="1/cm">0.0693582</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.065</Q>
+        <I unit="1/cm">7.04789</I>
+        <Idev unit="1/cm">0.0677591</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.067</Q>
+        <I unit="1/cm">6.53311</I>
+        <Idev unit="1/cm">0.0652207</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.069</Q>
+        <I unit="1/cm">6.2453</I>
+        <Idev unit="1/cm">0.0642016</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.071</Q>
+        <I unit="1/cm">5.94152</I>
+        <Idev unit="1/cm">0.0625768</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.073</Q>
+        <I unit="1/cm">5.70816</I>
+        <Idev unit="1/cm">0.0612955</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.075</Q>
+        <I unit="1/cm">5.24449</I>
+        <Idev unit="1/cm">0.060141</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.077</Q>
+        <I unit="1/cm">5.08291</I>
+        <Idev unit="1/cm">0.0582239</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.079</Q>
+        <I unit="1/cm">4.88135</I>
+        <Idev unit="1/cm">0.057969</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.081</Q>
+        <I unit="1/cm">4.60942</I>
+        <Idev unit="1/cm">0.056813</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.083</Q>
+        <I unit="1/cm">4.46606</I>
+        <Idev unit="1/cm">0.0569381</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.085</Q>
+        <I unit="1/cm">4.32473</I>
+        <Idev unit="1/cm">0.0558766</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.087</Q>
+        <I unit="1/cm">4.14144</I>
+        <Idev unit="1/cm">0.0552525</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.089</Q>
+        <I unit="1/cm">3.86504</I>
+        <Idev unit="1/cm">0.0544569</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.091</Q>
+        <I unit="1/cm">3.74272</I>
+        <Idev unit="1/cm">0.0529596</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.093</Q>
+        <I unit="1/cm">3.68281</I>
+        <Idev unit="1/cm">0.052891</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.095</Q>
+        <I unit="1/cm">3.46991</I>
+        <Idev unit="1/cm">0.0517565</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.097</Q>
+        <I unit="1/cm">3.37244</I>
+        <Idev unit="1/cm">0.0509328</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.099</Q>
+        <I unit="1/cm">3.27074</I>
+        <Idev unit="1/cm">0.0505183</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.101</Q>
+        <I unit="1/cm">3.13326</I>
+        <Idev unit="1/cm">0.0490847</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.103</Q>
+        <I unit="1/cm">3.01387</I>
+        <Idev unit="1/cm">0.0487012</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.105</Q>
+        <I unit="1/cm">2.87628</I>
+        <Idev unit="1/cm">0.0484307</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.107</Q>
+        <I unit="1/cm">2.85043</I>
+        <Idev unit="1/cm">0.0476786</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.109</Q>
+        <I unit="1/cm">2.72799</I>
+        <Idev unit="1/cm">0.0475526</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.111</Q>
+        <I unit="1/cm">2.61206</I>
+        <Idev unit="1/cm">0.0467475</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.113</Q>
+        <I unit="1/cm">2.58895</I>
+        <Idev unit="1/cm">0.0469767</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.115</Q>
+        <I unit="1/cm">2.45987</I>
+        <Idev unit="1/cm">0.0460139</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.117</Q>
+        <I unit="1/cm">2.37723</I>
+        <Idev unit="1/cm">0.045272</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.119</Q>
+        <I unit="1/cm">2.34122</I>
+        <Idev unit="1/cm">0.0453741</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.121</Q>
+        <I unit="1/cm">2.21745</I>
+        <Idev unit="1/cm">0.0444485</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.123</Q>
+        <I unit="1/cm">2.12646</I>
+        <Idev unit="1/cm">0.0438385</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.125</Q>
+        <I unit="1/cm">2.11264</I>
+        <Idev unit="1/cm">0.0441662</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.127</Q>
+        <I unit="1/cm">2.07523</I>
+        <Idev unit="1/cm">0.0438979</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.129</Q>
+        <I unit="1/cm">2.03548</I>
+        <Idev unit="1/cm">0.0442422</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.131</Q>
+        <I unit="1/cm">1.92452</I>
+        <Idev unit="1/cm">0.0435959</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.133</Q>
+        <I unit="1/cm">1.90866</I>
+        <Idev unit="1/cm">0.0437401</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.135</Q>
+        <I unit="1/cm">1.91252</I>
+        <Idev unit="1/cm">0.0443163</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.137</Q>
+        <I unit="1/cm">1.80405</I>
+        <Idev unit="1/cm">0.043466</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.139</Q>
+        <I unit="1/cm">1.72166</I>
+        <Idev unit="1/cm">0.0429246</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.141</Q>
+        <I unit="1/cm">1.67199</I>
+        <Idev unit="1/cm">0.042469</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.143</Q>
+        <I unit="1/cm">1.63282</I>
+        <Idev unit="1/cm">0.0430074</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.145</Q>
+        <I unit="1/cm">1.63712</I>
+        <Idev unit="1/cm">0.0438557</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.147</Q>
+        <I unit="1/cm">1.5862</I>
+        <Idev unit="1/cm">0.0434135</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.149</Q>
+        <I unit="1/cm">1.56121</I>
+        <Idev unit="1/cm">0.0432591</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.151</Q>
+        <I unit="1/cm">1.49764</I>
+        <Idev unit="1/cm">0.0426577</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.153</Q>
+        <I unit="1/cm">1.53828</I>
+        <Idev unit="1/cm">0.0446481</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.155</Q>
+        <I unit="1/cm">1.47366</I>
+        <Idev unit="1/cm">0.0441973</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.157</Q>
+        <I unit="1/cm">1.40582</I>
+        <Idev unit="1/cm">0.0430461</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.159</Q>
+        <I unit="1/cm">1.40491</I>
+        <Idev unit="1/cm">0.0439883</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.161</Q>
+        <I unit="1/cm">1.34639</I>
+        <Idev unit="1/cm">0.044193</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.163</Q>
+        <I unit="1/cm">1.32238</I>
+        <Idev unit="1/cm">0.0438008</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.165</Q>
+        <I unit="1/cm">1.33885</I>
+        <Idev unit="1/cm">0.0445383</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.167</Q>
+        <I unit="1/cm">1.29608</I>
+        <Idev unit="1/cm">0.0451575</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.169</Q>
+        <I unit="1/cm">1.30562</I>
+        <Idev unit="1/cm">0.0460656</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.171</Q>
+        <I unit="1/cm">1.17147</I>
+        <Idev unit="1/cm">0.0435717</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.173</Q>
+        <I unit="1/cm">1.18565</I>
+        <Idev unit="1/cm">0.0449072</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.175</Q>
+        <I unit="1/cm">1.18944</I>
+        <Idev unit="1/cm">0.0465319</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.177</Q>
+        <I unit="1/cm">1.17055</I>
+        <Idev unit="1/cm">0.0456562</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.179</Q>
+        <I unit="1/cm">1.08571</I>
+        <Idev unit="1/cm">0.0453852</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.181</Q>
+        <I unit="1/cm">1.06208</I>
+        <Idev unit="1/cm">0.0463335</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.183</Q>
+        <I unit="1/cm">1.06187</I>
+        <Idev unit="1/cm">0.0458284</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.185</Q>
+        <I unit="1/cm">1.02727</I>
+        <Idev unit="1/cm">0.0472613</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.187</Q>
+        <I unit="1/cm">0.995169</I>
+        <Idev unit="1/cm">0.0465526</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.189</Q>
+        <I unit="1/cm">1.02569</I>
+        <Idev unit="1/cm">0.0483728</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.191</Q>
+        <I unit="1/cm">0.981154</I>
+        <Idev unit="1/cm">0.0490559</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.193</Q>
+        <I unit="1/cm">1.01831</I>
+        <Idev unit="1/cm">0.0502348</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.195</Q>
+        <I unit="1/cm">0.968102</I>
+        <Idev unit="1/cm">0.0504426</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.197</Q>
+        <I unit="1/cm">0.940656</I>
+        <Idev unit="1/cm">0.0512734</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.199</Q>
+        <I unit="1/cm">1.05762</I>
+        <Idev unit="1/cm">0.0547469</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.201</Q>
+        <I unit="1/cm">0.949872</I>
+        <Idev unit="1/cm">0.055229</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.203</Q>
+        <I unit="1/cm">0.891716</I>
+        <Idev unit="1/cm">0.0531346</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.205</Q>
+        <I unit="1/cm">0.876084</I>
+        <Idev unit="1/cm">0.0548681</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.207</Q>
+        <I unit="1/cm">0.932101</I>
+        <Idev unit="1/cm">0.0576812</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.209</Q>
+        <I unit="1/cm">0.927755</I>
+        <Idev unit="1/cm">0.0593404</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.211</Q>
+        <I unit="1/cm">0.87669</I>
+        <Idev unit="1/cm">0.0600369</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.213</Q>
+        <I unit="1/cm">0.809125</I>
+        <Idev unit="1/cm">0.0588107</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.215</Q>
+        <I unit="1/cm">0.941202</I>
+        <Idev unit="1/cm">0.0659121</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.217</Q>
+        <I unit="1/cm">0.946175</I>
+        <Idev unit="1/cm">0.0690784</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.219</Q>
+        <I unit="1/cm">0.859875</I>
+        <Idev unit="1/cm">0.0674435</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.221</Q>
+        <I unit="1/cm">0.959508</I>
+        <Idev unit="1/cm">0.0718856</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.223</Q>
+        <I unit="1/cm">0.763222</I>
+        <Idev unit="1/cm">0.0702866</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.225</Q>
+        <I unit="1/cm">0.785467</I>
+        <Idev unit="1/cm">0.0742144</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.227</Q>
+        <I unit="1/cm">0.81876</I>
+        <Idev unit="1/cm">0.074266</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.229</Q>
+        <I unit="1/cm">0.678311</I>
+        <Idev unit="1/cm">0.0722578</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.231</Q>
+        <I unit="1/cm">0.761442</I>
+        <Idev unit="1/cm">0.0814516</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.233</Q>
+        <I unit="1/cm">0.757076</I>
+        <Idev unit="1/cm">0.0825262</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.235</Q>
+        <I unit="1/cm">0.600636</I>
+        <Idev unit="1/cm">0.075041</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.237</Q>
+        <I unit="1/cm">0.685635</I>
+        <Idev unit="1/cm">0.0842392</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.239</Q>
+        <I unit="1/cm">0.799186</I>
+        <Idev unit="1/cm">0.0974365</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.241</Q>
+        <I unit="1/cm">0.737526</I>
+        <Idev unit="1/cm">0.0957286</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.243</Q>
+        <I unit="1/cm">0.716415</I>
+        <Idev unit="1/cm">0.0970448</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.245</Q>
+        <I unit="1/cm">0.720413</I>
+        <Idev unit="1/cm">0.0981996</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.247</Q>
+        <I unit="1/cm">0.604059</I>
+        <Idev unit="1/cm">0.100869</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.249</Q>
+        <I unit="1/cm">0.649073</I>
+        <Idev unit="1/cm">0.109281</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.251</Q>
+        <I unit="1/cm">0.700691</I>
+        <Idev unit="1/cm">0.114325</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.253</Q>
+        <I unit="1/cm">0.586789</I>
+        <Idev unit="1/cm">0.108324</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.255</Q>
+        <I unit="1/cm">0.765838</I>
+        <Idev unit="1/cm">0.139579</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.257</Q>
+        <I unit="1/cm">0.828968</I>
+        <Idev unit="1/cm">0.156723</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.259</Q>
+        <I unit="1/cm">0.616499</I>
+        <Idev unit="1/cm">0.137866</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.261</Q>
+        <I unit="1/cm">0.526011</I>
+        <Idev unit="1/cm">0.126209</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.263</Q>
+        <I unit="1/cm">0.51277</I>
+        <Idev unit="1/cm">0.126339</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.265</Q>
+        <I unit="1/cm">0.604189</I>
+        <Idev unit="1/cm">0.166393</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.267</Q>
+        <I unit="1/cm">0.738765</I>
+        <Idev unit="1/cm">0.194006</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.269</Q>
+        <I unit="1/cm">0.462803</I>
+        <Idev unit="1/cm">0.155354</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.271</Q>
+        <I unit="1/cm">0.478694</I>
+        <Idev unit="1/cm">0.171676</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.273</Q>
+        <I unit="1/cm">0.711983</I>
+        <Idev unit="1/cm">0.255539</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.275</Q>
+        <I unit="1/cm">0.473304</I>
+        <Idev unit="1/cm">0.230752</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.277</Q>
+        <I unit="1/cm">0.536817</I>
+        <Idev unit="1/cm">0.262627</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.279</Q>
+        <I unit="1/cm">0.660654</I>
+        <Idev unit="1/cm">0.297519</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.281</Q>
+        <I unit="1/cm">0.408902</I>
+        <Idev unit="1/cm">0.24585</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.283</Q>
+        <I unit="1/cm">0.0</I>
+        <Idev unit="1/cm">0.0</Idev>
+        <Qdev unit="1/A">0.0</Qdev>
+      </Idata>
+    </SASdata>
+    <SAStransmission_spectrum name="sample">
+      <Tdata>
+        <Lambda unit="A">2.2385</Lambda>
+        <T unit="none">0.81703</T>
+        <Tdev unit="none">0.0130497</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.31685</Lambda>
+        <T unit="none">0.801978</T>
+        <Tdev unit="none">0.0120051</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.39794</Lambda>
+        <T unit="none">0.782436</T>
+        <Tdev unit="none">0.0112577</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.48186</Lambda>
+        <T unit="none">0.795586</T>
+        <Tdev unit="none">0.01104</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.56873</Lambda>
+        <T unit="none">0.794175</T>
+        <Tdev unit="none">0.0107071</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.65864</Lambda>
+        <T unit="none">0.807059</T>
+        <Tdev unit="none">0.010757</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.75169</Lambda>
+        <T unit="none">0.797216</T>
+        <Tdev unit="none">0.0106204</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.848</Lambda>
+        <T unit="none">0.811763</T>
+        <Tdev unit="none">0.0107288</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.94768</Lambda>
+        <T unit="none">0.805778</T>
+        <Tdev unit="none">0.0105482</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.05085</Lambda>
+        <T unit="none">0.787672</T>
+        <Tdev unit="none">0.0103436</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.15763</Lambda>
+        <T unit="none">0.804061</T>
+        <Tdev unit="none">0.0105877</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.26814</Lambda>
+        <T unit="none">0.799089</T>
+        <Tdev unit="none">0.0105895</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.38253</Lambda>
+        <T unit="none">0.810401</T>
+        <Tdev unit="none">0.0109026</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.50092</Lambda>
+        <T unit="none">0.797859</T>
+        <Tdev unit="none">0.0108399</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.62345</Lambda>
+        <T unit="none">0.801003</T>
+        <Tdev unit="none">0.0110517</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.75027</Lambda>
+        <T unit="none">0.78509</T>
+        <Tdev unit="none">0.0110209</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.88153</Lambda>
+        <T unit="none">0.785537</T>
+        <Tdev unit="none">0.0111882</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.01738</Lambda>
+        <T unit="none">0.758743</T>
+        <Tdev unit="none">0.0110145</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.15799</Lambda>
+        <T unit="none">0.767664</T>
+        <Tdev unit="none">0.0110323</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.30352</Lambda>
+        <T unit="none">0.772965</T>
+        <Tdev unit="none">0.0110456</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.45414</Lambda>
+        <T unit="none">0.773616</T>
+        <Tdev unit="none">0.0109689</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.61004</Lambda>
+        <T unit="none">0.72275</T>
+        <Tdev unit="none">0.0106718</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.77139</Lambda>
+        <T unit="none">0.754627</T>
+        <Tdev unit="none">0.0107276</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.93839</Lambda>
+        <T unit="none">0.759325</T>
+        <Tdev unit="none">0.0105454</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">5.11123</Lambda>
+        <T unit="none">0.7544</T>
+        <Tdev unit="none">0.0106594</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">5.29012</Lambda>
+        <T unit="none">0.75748</T>
+        <Tdev unit="none">0.0107767</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">5.47528</Lambda>
+        <T unit="none">0.746847</T>
+        <Tdev unit="none">0.0107133</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">5.66691</Lambda>
+        <T unit="none">0.740591</T>
+        <Tdev unit="none">0.0109161</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">5.86525</Lambda>
+        <T unit="none">0.752582</T>
+        <Tdev unit="none">0.0113942</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">6.07054</Lambda>
+        <T unit="none">0.733384</T>
+        <Tdev unit="none">0.0114788</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">6.28301</Lambda>
+        <T unit="none">0.740944</T>
+        <Tdev unit="none">0.0120655</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">6.50291</Lambda>
+        <T unit="none">0.731187</T>
+        <Tdev unit="none">0.0119684</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">6.73051</Lambda>
+        <T unit="none">0.72167</T>
+        <Tdev unit="none">0.0125797</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">6.96608</Lambda>
+        <T unit="none">0.720803</T>
+        <Tdev unit="none">0.0135324</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">7.2099</Lambda>
+        <T unit="none">0.704751</T>
+        <Tdev unit="none">0.0140129</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">7.46224</Lambda>
+        <T unit="none">0.700147</T>
+        <Tdev unit="none">0.014837</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">7.72342</Lambda>
+        <T unit="none">0.707843</T>
+        <Tdev unit="none">0.015985</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">7.99374</Lambda>
+        <T unit="none">0.68084</T>
+        <Tdev unit="none">0.0167449</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">8.27352</Lambda>
+        <T unit="none">0.690755</T>
+        <Tdev unit="none">0.0181648</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">8.56309</Lambda>
+        <T unit="none">0.695218</T>
+        <Tdev unit="none">0.0197214</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">8.8628</Lambda>
+        <T unit="none">0.663369</T>
+        <Tdev unit="none">0.0205081</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">9.173</Lambda>
+        <T unit="none">0.656758</T>
+        <Tdev unit="none">0.0219522</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">9.49406</Lambda>
+        <T unit="none">0.668971</T>
+        <Tdev unit="none">0.0248015</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">9.82867</Lambda>
+        <T unit="none">0.643715</T>
+        <Tdev unit="none">0.0263197</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">5.0</Lambda>
+        <T unit="none">-3.78577e-270</T>
+        <Tdev unit="none">-8.61158000229e-315</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">-1.24052e-265</Lambda>
+        <T unit="none">0.0130497</T>
+        <Tdev unit="none">3919.89</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">6.22902e-151</Lambda>
+        <T unit="none">0.0120051</T>
+        <Tdev unit="none">4462.63</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">6.22902e-151</Lambda>
+        <T unit="none">0.0112577</T>
+        <Tdev unit="none">4830.61</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.18146e+15</Lambda>
+        <T unit="none">0.01104</T>
+        <Tdev unit="none">5193.21</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.18146e+15</Lambda>
+        <T unit="none">0.0107071</T>
+        <Tdev unit="none">5501.58</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">5.83244494916e-320</Lambda>
+        <T unit="none">0.010757</T>
+        <Tdev unit="none">5628.96</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">5.82009e-73</Lambda>
+        <T unit="none">0.0106204</T>
+        <Tdev unit="none">5634.75</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.86436e+126</Lambda>
+        <T unit="none">0.0107288</T>
+        <Tdev unit="none">5724.73</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">6.43127e+247</Lambda>
+        <T unit="none">0.0105482</T>
+        <Tdev unit="none">5835.49</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">6.43127e+247</Lambda>
+        <T unit="none">0.0103436</T>
+        <Tdev unit="none">5798.97</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">-2.37127e+226</Lambda>
+        <T unit="none">0.0105877</T>
+        <Tdev unit="none">5767.32</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.86442e+126</Lambda>
+        <T unit="none">0.0105895</T>
+        <Tdev unit="none">5694.24</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">5.52737e-309</Lambda>
+        <T unit="none">0.0109026</T>
+        <Tdev unit="none">5525.05</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.46672e-310</Lambda>
+        <T unit="none">0.0108399</T>
+        <Tdev unit="none">5417.49</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.66641e+178</Lambda>
+        <T unit="none">0.0110517</T>
+        <Tdev unit="none">5253.01</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.66641e+178</Lambda>
+        <T unit="none">0.0110209</T>
+        <Tdev unit="none">5074.68</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">8.62375e+211</Lambda>
+        <T unit="none">0.0111882</T>
+        <Tdev unit="none">4929.65</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">8.62375e+211</Lambda>
+        <T unit="none">0.0110145</T>
+        <Tdev unit="none">4745.3</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.03531e-87</Lambda>
+        <T unit="none">0.0110323</T>
+        <Tdev unit="none">4841.86</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.97389e-39</Lambda>
+        <T unit="none">0.0110456</T>
+        <Tdev unit="none">4897.12</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.97389e-39</Lambda>
+        <T unit="none">0.0109689</T>
+        <Tdev unit="none">4974.21</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.18818e-212</Lambda>
+        <T unit="none">0.0106718</T>
+        <Tdev unit="none">4586.67</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.38734e+245</Lambda>
+        <T unit="none">0.0107276</T>
+        <Tdev unit="none">4948.31</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.38734e+245</Lambda>
+        <T unit="none">0.0105454</T>
+        <Tdev unit="none">5184.8</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">-1.81729e+131</Lambda>
+        <T unit="none">0.0106594</T>
+        <Tdev unit="none">5008.83</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">-1.81729e+131</Lambda>
+        <T unit="none">0.0107767</T>
+        <Tdev unit="none">4940.5</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">6.44115e-232</Lambda>
+        <T unit="none">0.0107133</T>
+        <Tdev unit="none">4859.81</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">6.44115e-232</Lambda>
+        <T unit="none">0.0109161</T>
+        <Tdev unit="none">4602.81</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.36995e+245</Lambda>
+        <T unit="none">0.0113942</T>
+        <Tdev unit="none">4362.55</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.36995e+245</Lambda>
+        <T unit="none">0.0114788</T>
+        <Tdev unit="none">4081.97</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.9782e-39</Lambda>
+        <T unit="none">0.0120655</T>
+        <Tdev unit="none">3771.18</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">5.83667e-73</Lambda>
+        <T unit="none">0.0119684</T>
+        <Tdev unit="none">3732.39</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.74941e+64</Lambda>
+        <T unit="none">0.0125797</T>
+        <Tdev unit="none">3291.09</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.74941e+64</Lambda>
+        <T unit="none">0.0135324</T>
+        <Tdev unit="none">2837.17</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">-1.81729e+131</Lambda>
+        <T unit="none">0.0140129</T>
+        <Tdev unit="none">2529.37</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">-1.81729e+131</Lambda>
+        <T unit="none">0.014837</T>
+        <Tdev unit="none">2226.82</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.40721e-280</Lambda>
+        <T unit="none">0.015985</T>
+        <Tdev unit="none">1960.88</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.40721e-280</Lambda>
+        <T unit="none">0.0167449</T>
+        <Tdev unit="none">1653.2</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.84467e+19</Lambda>
+        <T unit="none">0.0181648</T>
+        <Tdev unit="none">1446.05</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">5.67321e+216</Lambda>
+        <T unit="none">0.0197214</T>
+        <Tdev unit="none">1242.7</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.49371e+245</Lambda>
+        <T unit="none">0.0205081</T>
+        <Tdev unit="none">1046.31</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.49371e+245</Lambda>
+        <T unit="none">0.0219522</T>
+        <Tdev unit="none">895.069</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.69054e+192</Lambda>
+        <T unit="none">0.0248015</T>
+        <Tdev unit="none">727.543</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">8.62169e+211</Lambda>
+        <T unit="none">0.0263197</T>
+        <Tdev unit="none">598.171</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">8.62169e+211</Lambda>
+        <T unit="none">-8.61158000229e-315</T>
+        <Tdev unit="none">-8.61158000229e-315</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.74996e-68</Lambda>
+        <T unit="none">3919.89</T>
+        <Tdev unit="none">2.2385</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">8.75213e-78</Lambda>
+        <T unit="none">4462.63</T>
+        <Tdev unit="none">2.31685</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">-3.14338999988e-315</Lambda>
+        <T unit="none">4830.61</T>
+        <Tdev unit="none">2.39794</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.08255e-226</Lambda>
+        <T unit="none">5193.21</T>
+        <Tdev unit="none">2.48186</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.07499e+102</Lambda>
+        <T unit="none">5501.58</T>
+        <Tdev unit="none">2.56873</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.07499e+102</Lambda>
+        <T unit="none">5628.96</T>
+        <Tdev unit="none">2.65864</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.07508e+102</Lambda>
+        <T unit="none">5634.75</T>
+        <Tdev unit="none">2.75169</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.07508e+102</Lambda>
+        <T unit="none">5724.73</T>
+        <Tdev unit="none">2.848</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.81253e-303</Lambda>
+        <T unit="none">5835.49</T>
+        <Tdev unit="none">2.94768</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.35808e-312</Lambda>
+        <T unit="none">5798.97</T>
+        <Tdev unit="none">3.05085</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.07513e+102</Lambda>
+        <T unit="none">5767.32</T>
+        <Tdev unit="none">3.15763</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.07513e+102</Lambda>
+        <T unit="none">5694.24</T>
+        <Tdev unit="none">3.26814</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.38310999756e-315</Lambda>
+        <T unit="none">5525.05</T>
+        <Tdev unit="none">3.38253</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">8.52703999979e-316</Lambda>
+        <T unit="none">5417.49</T>
+        <Tdev unit="none">3.50092</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">0.0</Lambda>
+        <T unit="none">5253.01</T>
+        <Tdev unit="none">3.62345</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">0.0</Lambda>
+        <T unit="none">5074.68</T>
+        <Tdev unit="none">3.75027</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">0.0</Lambda>
+        <T unit="none">4929.65</T>
+        <Tdev unit="none">3.88153</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.54616000203e-315</Lambda>
+        <T unit="none">4745.3</T>
+        <Tdev unit="none">4.01738</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.54616000203e-315</Lambda>
+        <T unit="none">4841.86</T>
+        <Tdev unit="none">4.15799</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.71357e+104</Lambda>
+        <T unit="none">4897.12</T>
+        <Tdev unit="none">4.30352</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.72432e+104</Lambda>
+        <T unit="none">4974.21</T>
+        <Tdev unit="none">4.45414</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.15015e+102</Lambda>
+        <T unit="none">4586.67</T>
+        <Tdev unit="none">4.61004</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.07508e+102</Lambda>
+        <T unit="none">4948.31</T>
+        <Tdev unit="none">4.77139</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.53040999951e-315</Lambda>
+        <T unit="none">5184.8</T>
+        <Tdev unit="none">4.93839</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">0.0</Lambda>
+        <T unit="none">5008.83</T>
+        <Tdev unit="none">5.11123</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">0.0</Lambda>
+        <T unit="none">4940.5</T>
+        <Tdev unit="none">5.29012</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.00379e-270</Lambda>
+        <T unit="none">4859.81</T>
+        <Tdev unit="none">5.47528</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">2.00379e-270</Lambda>
+        <T unit="none">4602.81</T>
+        <Tdev unit="none">5.66691</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.58351e-312</Lambda>
+        <T unit="none">4362.55</T>
+        <Tdev unit="none">5.86525</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.7472e-287</Lambda>
+        <T unit="none">4081.97</T>
+        <Tdev unit="none">6.07054</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.74845e-287</Lambda>
+        <T unit="none">3771.18</T>
+        <Tdev unit="none">6.28301</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.24882e-290</Lambda>
+        <T unit="none">3732.39</T>
+        <Tdev unit="none">6.50291</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">0.0</Lambda>
+        <T unit="none">3291.09</T>
+        <Tdev unit="none">6.73051</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">0.0</Lambda>
+        <T unit="none">2837.17</T>
+        <Tdev unit="none">6.96608</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">0.0</Lambda>
+        <T unit="none">2529.37</T>
+        <Tdev unit="none">7.2099</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">0.0</Lambda>
+        <T unit="none">2226.82</T>
+        <Tdev unit="none">7.46224</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">1.07499e+102</Lambda>
+        <T unit="none">1960.88</T>
+        <Tdev unit="none">7.72342</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.32977e-311</Lambda>
+        <T unit="none">1653.2</T>
+        <Tdev unit="none">7.99374</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">7.19961e-310</Lambda>
+        <T unit="none">1446.05</T>
+        <Tdev unit="none">8.27352</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">7.19962e-310</Lambda>
+        <T unit="none">1242.7</T>
+        <Tdev unit="none">8.56309</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">8.2010700122e-316</Lambda>
+        <T unit="none">1046.31</T>
+        <Tdev unit="none">8.8628</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.18299000022e-314</Lambda>
+        <T unit="none">895.069</T>
+        <Tdev unit="none">9.173</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">7.42699000005e-314</Lambda>
+        <T unit="none">727.543</T>
+        <Tdev unit="none">9.49406</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">4.24398999993e-314</Lambda>
+        <T unit="none">598.171</T>
+        <Tdev unit="none">9.82867</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.16202013338e-322</Lambda>
+        <T unit="none">-8.61158000229e-315</T>
+        <Tdev unit="none">-3.78577e-270</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">0.0</Lambda>
+        <T unit="none">2.2385</T>
+        <Tdev unit="none">0.00307782</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">0.0</Lambda>
+        <T unit="none">2.31685</T>
+        <Tdev unit="none">0.00300224</Tdev>
+      </Tdata>
+      <Tdata>
+        <Lambda unit="A">3.53040999951e-315</Lambda>
+        <T unit="none">2.39794</T>
+        <Tdev unit="none">0.00292546</Tdev>
+      </Tdata>
+    </SAStransmission_spectrum>
+    <SASsample name="">
+      <ID>TK49 c10_SANS</ID>
+    </SASsample>
+    <SASinstrument>
+      <name>LOQ</name>
+      <SASsource>
+        <radiation>neutron</radiation>
+      </SASsource>
+      <SAScollimation/>
+      <SASdetector>
+        <name>HAB</name>
+        <SDD unit="mm">575.0</SDD>
+      </SASdetector>
+      <SASdetector>
+        <name>main-detector-bank</name>
+        <SDD unit="mm">4145.02</SDD>
+      </SASdetector>
+    </SASinstrument>
+    <SASprocess>
+      <name>Mantid generated CanSAS1D XML</name>
+      <date>02-Aug-2013 16:53:56</date>
+      <description></description>
+      <term name="svn">2.5.3</term>
+      <term name="user_file">K:/masks/MASKLOQ_MAN_132E_Lu_Banjo_12mm.txt</term>
+      <SASprocessnote></SASprocessnote>
+    </SASprocess>
+    <SASnote></SASnote>
+  </SASentry>
+</SASroot>
Index: test/sasdataloader/test/ring_testdata.txt
===================================================================
--- test/sasdataloader/test/ring_testdata.txt	(revision 8c9ffde290eafed946f800881bf4901b48445d4c)
+++ test/sasdataloader/test/ring_testdata.txt	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -1,21 +1,21 @@
 <X>   <Y>   <dY>
-0.157079632679 0.892216637179 0.0775663414595
-0.471238898038 0.98455818481 0.079657697118
-0.785398163397 0.961797998125 0.0788556980394
-1.09955742876 0.97171642327 0.0791285423182
-1.41371669412 1.0146882474 0.082063426639
-1.72787595947 1.00992701463 0.080353091764
-2.04203522483 1.02880481582 0.0815342153253
-2.35619449019 1.00598046038 0.0798251732283
-2.67035375555 1.07871021115 0.0836335498662
-2.98451302091 0.998456910563 0.079747331585
-3.29867228627 1.04419570592 0.0830428241489
-3.61283155163 1.01232642025 0.0808308513267
-3.92699081699 1.0083937443 0.0810028887009
-4.24115008235 1.03216852956 0.0810389534812
-4.55530934771 1.06499475793 0.0814085230439
-4.86946861306 0.982265097403 0.0805528988046
-5.18362787842 1.00390126667 0.0806633561062
-5.49778714378 0.980815954717 0.0793145659499
-5.81194640914 0.907713166456 0.0765782956648
-6.1261056745 0.983188286879 0.0797444057771
+0.0 0.974491286452 0.0803843574327
+0.314159265359 0.9046853025 0.0768971192264
+0.628318530718 0.964040908176 0.0790933208542
+0.942477796077 0.922142905769 0.0781616076625
+1.25663706144 1.02710537736 0.080875897538
+1.57079632679 1.01448978075 0.0808313893873
+1.88495559215 1.04677136013 0.0828850195035
+2.19911485751 1.00067189877 0.0790510747578
+2.51327412287 1.06280533013 0.0830643956456
+2.82743338823 1.04313751703 0.0824585190353
+3.14159265359 0.993559460696 0.0803376331443
+3.45575191895 0.998101030127 0.0813124293449
+3.76991118431 1.04589910764 0.0821364674302
+4.08407044967 0.997201556522 0.0797466854806
+4.39822971503 1.07289797405 0.0830165798358
+4.71238898038 1.01212391625 0.0803021745794
+5.02654824574 0.995907123899 0.0804649435453
+5.3407075111 0.991431571613 0.0803765721376
+5.65486677646 0.959020086792 0.0787114622667
+5.96902604182 0.945705788519 0.0767669312314
Index: test/sasdataloader/test/write_test.xml
===================================================================
--- test/sasdataloader/test/write_test.xml	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
+++ test/sasdataloader/test/write_test.xml	(revision 400155bab01bdb35b3cf83069f57cf9f47005bca)
@@ -0,0 +1,114 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<SASroot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="cansas1d/1.0" version="1.0" xsi:schemaLocation="cansas1d/1.0 http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd">
+  <SASentry>
+    <Title>Test title</Title>
+    <Run name="run name">1234</Run>
+    <SASdata>
+      <Idata>
+        <Q unit="1/A">0.02</Q>
+        <I unit="1/cm">1000.0</I>
+        <Idev unit="1/cm">3.0</Idev>
+        <Qdev unit="1/A">0.01</Qdev>
+      </Idata>
+      <Idata>
+        <Q unit="1/A">0.03</Q>
+        <I unit="1/cm">1001.0</I>
+        <Idev unit="1/cm">4.0</Idev>
+        <Qdev unit="1/A">0.02</Qdev>
+      </Idata>
+    </SASdata>
+    <SASsample name="my sample">
+      <ID>SI600-new-long</ID>
+      <thickness unit="mm">1.03</thickness>
+      <transmission>0.327</transmission>
+      <temperature unit="C">0.0</temperature>
+      <position>
+        <x unit="mm">10.0</x>
+        <y unit="mm">0.0</y>
+      </position>
+      <orientation>
+        <roll unit="degree">22.5</roll>
+        <pitch unit="degree">0.02</pitch>
+      </orientation>
+      <details>http://chemtools.chem.soton.ac.uk/projects/blog/blogs.php/bit_id/2720</details>
+      <details>Some text here</details>
+    </SASsample>
+    <SASinstrument>
+      <name>canSAS instrument</name>
+      <SASsource name="source name">
+        <radiation>neutron</radiation>
+        <beam_size name="bm">
+          <x unit="mm">12.0</x>
+          <y unit="mm">13.0</y>
+        </beam_size>
+        <beam_shape>disc</beam_shape>
+        <wavelength unit="A">6.0</wavelength>
+        <wavelength_min unit="nm">0.22</wavelength_min>
+        <wavelength_max unit="nm">1.0</wavelength_max>
+        <wavelength_spread unit="percent">14.3</wavelength_spread>
+      </SASsource>
+      <SAScollimation name="test coll name">
+        <length unit="mm">123.0</length>
+        <aperture name="source" type="radius">
+          <size>
+            <x unit="mm">50.0</x>
+          </size>
+          <distance unit="mm">11000.0</distance>
+        </aperture>
+        <aperture name="sample" type="radius">
+          <size>
+            <x unit="mm">1.0</x>
+          </size>
+        </aperture>
+      </SAScollimation>
+      <SASdetector>
+        <name>fictional hybrid</name>
+        <SDD unit="mm">4150.0</SDD>
+        <offset>
+          <x unit="m">0.001</x>
+          <y unit="m">0.002</y>
+        </offset>
+        <orientation>
+          <roll unit="degree">1.0</roll>
+          <pitch unit="degree">0.0</pitch>
+          <yaw unit="degree">0.0</yaw>
+        </orientation>
+        <beam_center>
+          <x unit="mm">322.64</x>
+          <y unit="mm">327.68</y>
+        </beam_center>
+        <pixel_size>
+          <x unit="mm">5.0</x>
+          <y unit="mm">5.0</y>
+        </pixel_size>
+      </SASdetector>
+    </SASinstrument>
+    <SASprocess>
+      <name>spol</name>
+      <date>04-Sep-2007 18:35:02</date>
+      <description></description>
+      <term name="radialstep" unit="mm">10.000</term>
+      <term name="sector_width" unit="degree">180.0</term>
+      <term name="sector_orient" unit="degree">0.0</term>
+      <term name="MASK_file">USER:MASK.COM</term>
+      <SASprocessnote></SASprocessnote>
+    </SASprocess>
+    <SASprocess>
+      <name>NCNR-IGOR</name>
+      <date>03-SEP-2006 11:42:47</date>
+      <description></description>
+      <term name="average_type">Circular</term>
+      <term name="SAM_file">SEP06064.SA3_AJJ_L205</term>
+      <term name="BKD_file">SEP06064.SA3_AJJ_L205</term>
+      <term name="EMP_file">SEP06064.SA3_AJJ_L205</term>
+      <term name="DIV_file">SEP06064.SA3_AJJ_L205</term>
+      <term name="MASK_file">SEP06064.SA3_AJJ_L205</term>
+      <term name="ABS:TSTAND">1</term>
+      <term name="ABS:DSTAND" unit="mm">1</term>
+      <term name="ABS:IZERO">230.09</term>
+      <term name="ABS:XSECT" unit="mm">1</term>
+      <SASprocessnote></SASprocessnote>
+    </SASprocess>
+    <SASnote/>
+  </SASentry>
+</SASroot>
