Index: sansmodels/src/sans/models/BinaryHSModel.py
===================================================================
--- sansmodels/src/sans/models/BinaryHSModel.py	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
+++ sansmodels/src/sans/models/BinaryHSModel.py	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
@@ -0,0 +1,113 @@
+#!/usr/bin/env python
+"""
+	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
+"""
+
+""" Provide functionality for a C extension model
+
+	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\binaryHS.h
+ 	         AND RE-RUN THE GENERATOR SCRIPT
+
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans_extension.c_models import CBinaryHSModel
+import copy    
+    
+class BinaryHSModel(CBinaryHSModel, BaseComponent):
+    """ Class that evaluates a BinaryHSModel model. 
+    	This file was auto-generated from ..\c_extensions\binaryHS.h.
+    	Refer to that file and the structure it contains
+    	for details of the model.
+    	List of default parameters:
+         l_radius        = 160.0 [A]
+         s_radius        = 25.0 [A]
+         vol_frac_ls     = 0.2 
+         vol_frac_ss     = 0.2 
+         ls_sld          = 3.5e-006 [1/A²]
+         ss_sld          = 5e-007 [1/A²]
+         solvent_sld     = 6.36e-006 [1/A²]
+         background      = 0.001 [1/cm]
+
+    """
+        
+    def __init__(self):
+        """ Initialization """
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        CBinaryHSModel.__init__(self)
+        
+        ## Name of the model
+        self.name = "BinaryHSModel"
+        ## Model description
+        self.description ="""
+		Model parameters:
+		
+		l_radius : large radius of the binary hard sphere
+		s_radius : small radius of the 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²]', None, None]
+        self.details['ss_sld'] = ['[1/A²]', None, None]
+        self.details['solvent_sld'] = ['[1/A²]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+		## fittable parameters
+        self.fixed=['l_radius.width', 's_radius.width']
+        
+        ## parameters with orientation
+        self.orientation_params =[]
+   
+    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 set_dispersion(self, parameter, dispersion):
+        """
+            Set the dispersion object for a model parameter
+            @param parameter: name of the parameter [string]
+            @dispersion: dispersion object of type DispersionModel
+        """
+        return CBinaryHSModel.set_dispersion(self, parameter, dispersion.cdisp)
+        
+   
+# End of file
Index: sansmodels/src/sans/models/BinaryHSPSF11Model.py
===================================================================
--- sansmodels/src/sans/models/BinaryHSPSF11Model.py	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
+++ sansmodels/src/sans/models/BinaryHSPSF11Model.py	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
@@ -0,0 +1,113 @@
+#!/usr/bin/env python
+"""
+	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
+"""
+
+""" Provide functionality for a C extension model
+
+	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\binaryHS_PSF11.h
+ 	         AND RE-RUN THE GENERATOR SCRIPT
+
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans_extension.c_models import CBinaryHSPSF11Model
+import copy    
+    
+class BinaryHSPSF11Model(CBinaryHSPSF11Model, BaseComponent):
+    """ Class that evaluates a BinaryHSPSF11Model model. 
+    	This file was auto-generated from ..\c_extensions\binaryHS_PSF11.h.
+    	Refer to that file and the structure it contains
+    	for details of the model.
+    	List of default parameters:
+         l_radius        = 160.0 [A]
+         s_radius        = 25.0 [A]
+         vol_frac_ls     = 0.2 
+         vol_frac_ss     = 0.2 
+         ls_sld          = 3.5e-006 [1/A²]
+         ss_sld          = 5e-007 [1/A²]
+         solvent_sld     = 6.36e-006 [1/A²]
+         background      = 0.001 [1/cm]
+
+    """
+        
+    def __init__(self):
+        """ Initialization """
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        CBinaryHSPSF11Model.__init__(self)
+        
+        ## Name of the model
+        self.name = "BinaryHSPSF11Model"
+        ## Model description
+        self.description ="""
+		Model parameters:
+		
+		l_radius : large radius of the binary hard sphere
+		s_radius : small radius of the 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²]', None, None]
+        self.details['ss_sld'] = ['[1/A²]', None, None]
+        self.details['solvent_sld'] = ['[1/A²]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+		## fittable parameters
+        self.fixed=['l_radius.width', 's_radius.width']
+        
+        ## parameters with orientation
+        self.orientation_params =[]
+   
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(BinaryHSPSF11Model())   
+   
+    def run(self, x = 0.0):
+        """ Evaluate the model
+            @param x: input q, or [q,phi]
+            @return: scattering function P(q)
+        """
+        
+        return CBinaryHSPSF11Model.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 CBinaryHSPSF11Model.runXY(self, x)
+        
+    def set_dispersion(self, parameter, dispersion):
+        """
+            Set the dispersion object for a model parameter
+            @param parameter: name of the parameter [string]
+            @dispersion: dispersion object of type DispersionModel
+        """
+        return CBinaryHSPSF11Model.set_dispersion(self, parameter, dispersion.cdisp)
+        
+   
+# End of file
Index: sansmodels/src/sans/models/MultiShellModel.py
===================================================================
--- sansmodels/src/sans/models/MultiShellModel.py	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
+++ sansmodels/src/sans/models/MultiShellModel.py	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
@@ -0,0 +1,112 @@
+#!/usr/bin/env python
+"""
+	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
+"""
+
+""" Provide functionality for a C extension model
+
+	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\multishell.h
+ 	         AND RE-RUN THE GENERATOR SCRIPT
+
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans_extension.c_models import CMultiShellModel
+import copy    
+    
+class MultiShellModel(CMultiShellModel, BaseComponent):
+    """ Class that evaluates a MultiShellModel model. 
+    	This file was auto-generated from ..\c_extensions\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-006 [1/A²]
+         shell_sld       = 4e-007 [1/A²]
+         n_pairs         = 2.0 
+         background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self):
+        """ Initialization """
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        CMultiShellModel.__init__(self)
+        
+        ## Name of the model
+        self.name = "MultiShellModel"
+        ## Model description
+        self.description ="""
+		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²]', None, None]
+        self.details['shell_sld'] = ['[1/A²]', None, None]
+        self.details['n_pairs'] = ['', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+		## fittable parameters
+        self.fixed=['radius.width']
+        
+        ## parameters with orientation
+        self.orientation_params =[]
+   
+    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 set_dispersion(self, parameter, dispersion):
+        """
+            Set the dispersion object for a model parameter
+            @param parameter: name of the parameter [string]
+            @dispersion: dispersion object of type DispersionModel
+        """
+        return CMultiShellModel.set_dispersion(self, parameter, dispersion.cdisp)
+        
+   
+# End of file
Index: sansmodels/src/sans/models/VesicleModel.py
===================================================================
--- sansmodels/src/sans/models/VesicleModel.py	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
+++ sansmodels/src/sans/models/VesicleModel.py	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
@@ -0,0 +1,106 @@
+#!/usr/bin/env python
+"""
+	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
+"""
+
+""" Provide functionality for a C extension model
+
+	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\vesicle.h
+ 	         AND RE-RUN THE GENERATOR SCRIPT
+
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans_extension.c_models import CVesicleModel
+import copy    
+    
+class VesicleModel(CVesicleModel, BaseComponent):
+    """ Class that evaluates a VesicleModel model. 
+    	This file was auto-generated from ..\c_extensions\vesicle.h.
+    	Refer to that file and the structure it contains
+    	for details of the model.
+    	List of default parameters:
+         scale           = 1.0 
+         core_radius     = 100.0 [A]
+         thickness       = 30.0 [A]
+         core_sld        = 6.36e-006 [1/A²]
+         shell_sld       = 5e-007 [1/A²]
+         background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self):
+        """ Initialization """
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        CVesicleModel.__init__(self)
+        
+        ## Name of the model
+        self.name = "VesicleModel"
+        ## Model description
+        self.description ="""
+		Model parameters:
+		scale : scale factor
+		core_radius : Core radius of the vesicle
+		thickness: shell thickness
+		core_sld: core scattering length density
+		shell_sld: shell scattering length density
+		background: incoherent background"""
+       
+		## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['core_radius'] = ['[A]', None, None]
+        self.details['thickness'] = ['[A]', None, None]
+        self.details['core_sld'] = ['[1/A²]', None, None]
+        self.details['shell_sld'] = ['[1/A²]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+		## fittable parameters
+        self.fixed=['core_radius.width']
+        
+        ## parameters with orientation
+        self.orientation_params =[]
+   
+    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 set_dispersion(self, parameter, dispersion):
+        """
+            Set the dispersion object for a model parameter
+            @param parameter: name of the parameter [string]
+            @dispersion: dispersion object of type DispersionModel
+        """
+        return CVesicleModel.set_dispersion(self, parameter, dispersion.cdisp)
+        
+   
+# End of file
Index: sansmodels/src/sans/models/c_extensions/binaryHS_PSF11.c
===================================================================
--- sansmodels/src/sans/models/c_extensions/binaryHS_PSF11.c	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
+++ sansmodels/src/sans/models/c_extensions/binaryHS_PSF11.c	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
@@ -0,0 +1,44 @@
+/**
+ * Scattering model for a sphere
+ * @author: Gervaise B alina / UTK
+ */
+
+#include "binaryHS_PSF11.h"
+#include "libSphere.h"
+#include <math.h>
+
+
+/**
+ * Function to evaluate 1D scattering function
+ * @param pars: parameters of the binary hard sphere
+ * @param q: q-value
+ * @return: function value
+ */
+double binaryHS_PSF11_analytical_1D(BinaryHSPSF11Parameters *pars, double q) {
+	double dp[8];
+	
+	dp[0] = pars->l_radius;
+	dp[1] = pars->s_radius;
+	dp[2] = pars->vol_frac_ls;
+	dp[3] = pars->vol_frac_ss;
+	dp[4] = pars->ls_sld;
+	dp[5] = pars->ss_sld;
+	dp[6] = pars->solvent_sld;
+	dp[7] = pars->background;
+	
+	return BinaryHS_PSF11(dp, q);
+}
+    
+/**
+ * Function to evaluate 2D scattering function
+ * @param pars: parameters of the binary hard sphere
+ * @param q: q-value
+ * @return: function value
+ */
+double binaryHS_PSF11_analytical_2D(BinaryHSPSF11Parameters *pars, double q, double phi) {
+	return binaryHS_PSF11_analytical_1D(pars,q);
+}
+
+double binaryHS_PSF11_analytical_2DXY(BinaryHSPSF11Parameters *pars, double qx, double qy){
+	return binaryHS_PSF11_analytical_1D(pars,sqrt(qx*qx+qy*qy));	
+}
Index: sansmodels/src/sans/models/c_extensions/binaryHS_PSF11.h
===================================================================
--- sansmodels/src/sans/models/c_extensions/binaryHS_PSF11.h	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
+++ sansmodels/src/sans/models/c_extensions/binaryHS_PSF11.h	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
@@ -0,0 +1,69 @@
+#if !defined(binaryHS_PSF11_h)
+#define binaryHS_PSF11_h
+
+/**
+ * Structure definition for binary hard sphere parameters
+
+	[PYTHONCLASS] = BinaryHSPSF11Model
+	[DISP_PARAMS] = l_radius,s_radius
+	[DESCRIPTION] =<text>
+						Model parameters:
+						
+						l_radius : large radius of the binary hard sphere
+						s_radius : small radius of the 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
+               </text>
+	[FIXED]= l_radius.width;s_radius.width
+	[ORIENTATION_PARAMS]= <text> </text>
+ */
+typedef struct {
+    
+	///	large radius of the binary hard sphere [A]
+    //  [DEFAULT]=l_radius= 160.0 [A]
+    double l_radius;
+
+    ///	small radius of the binary hard sphere [A]
+    //  [DEFAULT]=s_radius= 25.0 [A]
+    double s_radius;
+
+	///	volume fraction of large spheres 
+    //  [DEFAULT]=vol_frac_ls= 0.2 
+    double vol_frac_ls;
+
+	///	volume fraction of small spheres 
+    //  [DEFAULT]=vol_frac_ss= 0.2 
+    double vol_frac_ss;
+
+	///	large sphere scattering length density [1/Å²]
+    //  [DEFAULT]=ls_sld= 3.5e-6 [1/A²]
+    double ls_sld;
+
+	///	lsmall sphere scattering length density [1/Å²]
+    //  [DEFAULT]=ss_sld= 5e-7 [1/A²]
+    double ss_sld;
+
+    ///	solvent scattering length density [1/Å²]
+    //  [DEFAULT]=solvent_sld= 6.36e-6 [1/A²]
+    double solvent_sld;
+
+	/// Incoherent Background [1/cm]
+	//  [DEFAULT]=background=0.001 [1/cm]
+	double background;
+
+} BinaryHSPSF11Parameters;
+
+
+
+/// 1D scattering function
+double binaryHS_PSF11_analytical_1D(BinaryHSPSF11Parameters *pars, double q);
+
+/// 2D scattering function
+double binaryHS_PSF11_analytical_2D(BinaryHSPSF11Parameters *pars, double q, double phi);
+double binaryHS_PSF11_analytical_2DXY(BinaryHSPSF11Parameters *pars, double qx, double qy);
+
+#endif
Index: sansmodels/src/sans/models/c_extensions/c_models.c
===================================================================
--- sansmodels/src/sans/models/c_extensions/c_models.c	(revision 3d25331f0e8a822fc6c59f15883b1cd21463b567)
+++ sansmodels/src/sans/models/c_extensions/c_models.c	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
@@ -55,4 +55,5 @@
 	addCVesicleModel(m);
 	addCBinaryHSModel(m);
+	addCBinaryHSPSF11Model(m);
 
 }
Index: sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
+++ sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
@@ -0,0 +1,384 @@
+/**
+	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
+ */
+
+/** CBinaryHSPSF11Model
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY binaryHS_PSF11.h
+ *          AND RE-RUN THE GENERATOR SCRIPT
+ *
+ */
+ 
+extern "C" {
+#include <Python.h>
+#include "structmember.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+#include "binaryHS_PSF11.h"
+}
+
+#include "models.hh"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CBinaryHSPSF11ModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    BinaryHSPSF11Model * model;
+    /// Log for unit testing
+    PyObject * log;
+} CBinaryHSPSF11Model;
+
+
+static void
+CBinaryHSPSF11Model_dealloc(CBinaryHSPSF11Model* self)
+{
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CBinaryHSPSF11Model_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CBinaryHSPSF11Model *self;
+    
+    self = (CBinaryHSPSF11Model *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CBinaryHSPSF11Model_init(CBinaryHSPSF11Model *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+        self->model = new BinaryHSPSF11Model();
+        
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"vol_frac_ls",Py_BuildValue("d",0.200000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000));
+        PyDict_SetItemString(self->params,"vol_frac_ss",Py_BuildValue("d",0.200000));
+        PyDict_SetItemString(self->params,"solvent_sld",Py_BuildValue("d",0.000006));
+        PyDict_SetItemString(self->params,"ls_sld",Py_BuildValue("d",0.000003));
+        PyDict_SetItemString(self->params,"ss_sld",Py_BuildValue("d",0.000000));
+        PyDict_SetItemString(self->params,"s_radius",Py_BuildValue("d",25.000000));
+        PyDict_SetItemString(self->params,"l_radius",Py_BuildValue("d",160.000000));
+        // 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 PyMemberDef CBinaryHSPSF11Model_members[] = {
+    {"params", T_OBJECT, offsetof(CBinaryHSPSF11Model, params), 0,
+     "Parameters"},
+	{"dispersion", T_OBJECT, offsetof(CBinaryHSPSF11Model, dispersion), 0,
+	  "Dispersion parameters"},     
+    {"log", T_OBJECT, offsetof(CBinaryHSPSF11Model, log), 0,
+     "Log"},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CBinaryHSPSF11Model_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 q or [q,phi]
+ * @return: function value
+ */
+static PyObject * run(CBinaryHSPSF11Model *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(CBinaryHSPSF11ModelError, 
+	    	"CBinaryHSPSF11Model.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(CBinaryHSPSF11ModelError, 
+	    		"CBinaryHSPSF11Model.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 = CBinaryHSPSF11Model_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CBinaryHSPSF11Model_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 = CBinaryHSPSF11Model_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CBinaryHSPSF11Model *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(CBinaryHSPSF11ModelError, 
+	    	"CBinaryHSPSF11Model.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(CBinaryHSPSF11ModelError, 
+	    		"CBinaryHSPSF11Model.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 = CBinaryHSPSF11Model_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CBinaryHSPSF11Model_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 = CBinaryHSPSF11Model_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CBinaryHSPSF11Model *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CBinaryHSPSF11Model *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CBinaryHSPSF11ModelError,
+	    	"CBinaryHSPSF11Model.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(CBinaryHSPSF11ModelError,
+	    	"CBinaryHSPSF11Model.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 CBinaryHSPSF11Model_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"},
+    {"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 CBinaryHSPSF11ModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CBinaryHSPSF11Model",             /*tp_name*/
+    sizeof(CBinaryHSPSF11Model),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CBinaryHSPSF11Model_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*/
+    "CBinaryHSPSF11Model objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CBinaryHSPSF11Model_methods,             /* tp_methods */
+    CBinaryHSPSF11Model_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CBinaryHSPSF11Model_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CBinaryHSPSF11Model_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 addCBinaryHSPSF11Model(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CBinaryHSPSF11ModelType) < 0)
+        return;
+
+    Py_INCREF(&CBinaryHSPSF11ModelType);
+    PyModule_AddObject(module, "CBinaryHSPSF11Model", (PyObject *)&CBinaryHSPSF11ModelType);
+    
+    d = PyModule_GetDict(module);
+    CBinaryHSPSF11ModelError = PyErr_NewException("CBinaryHSPSF11Model.error", NULL, NULL);
+    PyDict_SetItemString(d, "CBinaryHSPSF11ModelError", CBinaryHSPSF11ModelError);
+}
+
Index: sansmodels/src/sans/models/c_models/binaryHS_PSF11.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/binaryHS_PSF11.cpp	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
+++ sansmodels/src/sans/models/c_models/binaryHS_PSF11.cpp	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
@@ -0,0 +1,115 @@
+/**
+	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
+ */
+
+/**
+ * Scattering model classes
+ * The classes use the IGOR library found in
+ *   sansmodels/src/libigor
+ *
+ */
+
+#include <math.h>
+#include "models.hh"
+#include "parameters.hh"
+#include <stdio.h>
+using namespace std;
+
+extern "C" {
+	#include "libSphere.h"
+}
+
+BinaryHSPSF11Model :: BinaryHSPSF11Model() {
+	
+	l_radius     = Parameter(160.0, true);
+	l_radius.set_min(0.0);
+	s_radius    = Parameter(25.0, true);
+	s_radius.set_min(0.0);
+	vol_frac_ls  = Parameter(0.2);
+	vol_frac_ss  = Parameter(0.1);
+	ls_sld      = Parameter(3.5e-6);
+	ss_sld     = Parameter(5e-7);
+	solvent_sld   = Parameter(6.36e-6);
+	background = Parameter(0.0);
+}
+
+/**
+ * Function to evaluate 1D scattering function
+ * The NIST IGOR library is used for the actual calculation.
+ * @param q: q-value
+ * @return: function value
+ */
+double BinaryHSPSF11Model :: operator()(double q) {
+	double dp[8];
+
+	// Fill parameter array for IGOR library
+	// Add the background after averaging
+	dp[0] = l_radius();
+	dp[1] = s_radius();
+	dp[2] = vol_frac_ls();
+	dp[3] = vol_frac_ss();
+	dp[4] = ls_sld();
+	dp[5] = ss_sld();
+	dp[6] = solvent_sld();
+	dp[7] = background();
+	
+
+	// Get the dispersion points for the large radius
+	vector<WeightPoint> weights_l_radius;
+	l_radius.get_weights(weights_l_radius);
+
+	// Get the dispersion points for the small radius
+	vector<WeightPoint> weights_s_radius;
+	s_radius.get_weights(weights_s_radius);
+
+	// Perform the computation, with all weight points
+	double sum = 0.0;
+	double norm = 0.0;
+
+	// Loop over larger radius weight points
+	for(int i=0; i< (int)weights_l_radius.size(); i++) {
+		dp[0] = weights_l_radius[i].value;
+		
+		// Loop over small radius weight points
+		for(int j=0; j< (int)weights_s_radius.size(); j++) {
+			dp[1] = weights_s_radius[j].value;
+
+
+			sum += weights_l_radius[i].weight *weights_s_radius[j].weight * BinaryHS_PSF11(dp, q);
+			norm += weights_l_radius[i].weight *weights_s_radius[j].weight;
+		}
+	}
+	return sum/norm + background();
+}
+
+/**
+ * Function to evaluate 2D scattering function
+ * @param q_x: value of Q along x
+ * @param q_y: value of Q along y
+ * @return: function value
+ */
+double BinaryHSPSF11Model :: operator()(double qx, double qy) {
+	double q = sqrt(qx*qx + qy*qy);
+	return (*this).operator()(q);
+}
+
+/**
+ * Function to evaluate 2D scattering function
+ * @param pars: parameters of the vesicle
+ * @param q: q-value
+ * @param phi: angle phi
+ * @return: function value
+ */
+double BinaryHSPSF11Model :: evaluate_rphi(double q, double phi) {
+	return (*this).operator()(q);
+}
Index: sansmodels/src/sans/models/c_models/c_models.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/c_models.cpp	(revision 3d25331f0e8a822fc6c59f15883b1cd21463b567)
+++ sansmodels/src/sans/models/c_models/c_models.cpp	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
@@ -35,4 +35,5 @@
 void addCVesicleModel(PyObject *module);
 void addCBinaryHSModel(PyObject *module);
+void addCBinaryHSPSF11Model(PyObject *module);
 
 
@@ -188,4 +189,5 @@
 	addCMultiShellModel(m);
 	addCBinaryHSModel(m);
+	addCBinaryHSPSF11Model(m);
 	addDisperser(m);
 	addCGaussian(m);
Index: sansmodels/src/sans/models/c_models/models.hh
===================================================================
--- sansmodels/src/sans/models/c_models/models.hh	(revision 3d25331f0e8a822fc6c59f15883b1cd21463b567)
+++ sansmodels/src/sans/models/c_models/models.hh	(revision 2c4b289dd897e67655e7c208484ad09f086d1094)
@@ -545,3 +545,24 @@
 };
 
+class BinaryHSPSF11Model{
+public:
+	// Model parameters
+	Parameter l_radius;
+	Parameter s_radius;
+	Parameter vol_frac_ls;
+	Parameter vol_frac_ss;
+	Parameter ls_sld;
+	Parameter ss_sld;
+	Parameter solvent_sld;
+	Parameter background;
+	
+	//Constructor
+	BinaryHSPSF11Model();
+	
+	//Operators to get I(Q)
+	double operator()(double q);
+	double operator()(double qx , double qy);
+	double evaluate_rphi(double q, double phi);
+};
+
 #endif
