Index: sansmodels/src/sans/models/BaseComponent.py
===================================================================
--- sansmodels/src/sans/models/BaseComponent.py	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/BaseComponent.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -85,6 +85,6 @@
             above, numpy arrays must be created the following way:
 
-            qx_prime = numpy.reshape(qx, [3,1])
-            qy_prime = numpy.reshape(qy, [1,3])
+            qx_prime = numpy.reshape(qx, [1,3])
+            qy_prime = numpy.reshape(qy, [3,1])
             
             The method is then called the following way:
@@ -106,9 +106,9 @@
             
             # Create output array
-            iq_array = numpy.zeros([qx.shape[0], qy.shape[1]])
+            iq_array = numpy.zeros([qx.shape[1], qy.shape[0]])
              
-            for i in range(qx.shape[0]):
-                for j in range(qy.shape[1]):
-                    iq_array[i][j] = self.runXY([qx[i][0],qy[0][j]])
+            for j in range(qy.shape[0]):
+                for i in range(qx.shape[1]):
+                    iq_array[j][i] = self.runXY([qx[0][i],qy[j][0]])
             return iq_array
                 
Index: sansmodels/src/sans/models/BinaryHSModel.py
===================================================================
--- sansmodels/src/sans/models/BinaryHSModel.py	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/BinaryHSModel.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -17,5 +17,5 @@
 
 	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\binaryHS.h
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\binaryHs.h
  	         AND RE-RUN THE GENERATOR SCRIPT
 
@@ -28,5 +28,5 @@
 class BinaryHSModel(CBinaryHSModel, BaseComponent):
     """ Class that evaluates a BinaryHSModel model. 
-    	This file was auto-generated from ..\c_extensions\binaryHS.h.
+    	This file was auto-generated from ..\c_extensions\binaryHs.h.
     	Refer to that file and the structure it contains
     	for details of the model.
Index: sansmodels/src/sans/models/FractalAbsModel.py
===================================================================
--- sansmodels/src/sans/models/FractalAbsModel.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
+++ sansmodels/src/sans/models/FractalAbsModel.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+""" 
+    
+    Provide F(x)= P(|x|)*S(|x|) + bkd
+    Fractal as a BaseComponent model
+"""
+
+from sans.models.FractalModel import FractalModel
+import math
+
+class FractalAbsModel(FractalModel):
+    """
+        Class that evaluates a Fractal function.
+        
+        F(|x|)= P(|x|)*S(|x|) + bkd
+        The model has Seven parameters: 
+            scale        =  Volume fraction
+            radius       =  Block radius
+            fractal_dim  =  Fractal dimension
+            corr_length  =  correlation Length
+            block_sld    =  SDL block
+            solvent_sld  =  SDL solvent
+            background   =  background
+           
+    """
+    def __init__(self):
+        """ Initialization """
+        # Initialize FractalModel 
+
+        FractalModel.__init__(self)
+        ## Name of the model
+        self.name = "Absolute Number Density Fractal"
+        self.description="""
+        I(x)= P(|x|)*S(|x|) + bkd
+        
+        p(x)= scale* V^(2)*delta^(2)* F(x*radius)^(2)
+        F(x) = 3*[sin(x)-x cos(x)]/x**3
+        
+        The model has Seven parameters: 
+        scale        =  Volume fraction
+        radius       =  Block radius
+        fractal_dim  =  Fractal dimension
+        corr_length  =  correlation Length
+        block_sld    =  SDL block
+        solvent_sld  =  SDL solvent
+        background   =  background
+        """
+    def _Fractal(self, x):
+        return FractalModel._Fractal(self, math.fabs(x))
Index: sansmodels/src/sans/models/FractalModel.py
===================================================================
--- sansmodels/src/sans/models/FractalModel.py	(revision 1ed3834d2e968f8ff632d0b368f55ac28174df7a)
+++ sansmodels/src/sans/models/FractalModel.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -30,5 +30,5 @@
         """ Initialization """
         
-        # Initialize BaseComponent first, then sphere
+        # Initialize BaseComponent first, then fractal
         BaseComponent.__init__(self)
         
Index: sansmodels/src/sans/models/HardsphereStructure.py
===================================================================
--- sansmodels/src/sans/models/HardsphereStructure.py	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/HardsphereStructure.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -17,5 +17,5 @@
 
 	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\hardsphere.h
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\Hardsphere.h
  	         AND RE-RUN THE GENERATOR SCRIPT
 
@@ -28,5 +28,5 @@
 class HardsphereStructure(CHardsphereStructure, BaseComponent):
     """ Class that evaluates a HardsphereStructure model. 
-    	This file was auto-generated from ..\c_extensions\hardsphere.h.
+    	This file was auto-generated from ..\c_extensions\Hardsphere.h.
     	Refer to that file and the structure it contains
     	for details of the model.
Index: sansmodels/src/sans/models/LogNormal.py
===================================================================
--- sansmodels/src/sans/models/LogNormal.py	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/LogNormal.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -17,5 +17,5 @@
 
 	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\lognormal.h
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\logNormal.h
  	         AND RE-RUN THE GENERATOR SCRIPT
 
@@ -28,5 +28,5 @@
 class LogNormal(CLogNormal, BaseComponent):
     """ Class that evaluates a LogNormal model. 
-    	This file was auto-generated from ..\c_extensions\lognormal.h.
+    	This file was auto-generated from ..\c_extensions\logNormal.h.
     	Refer to that file and the structure it contains
     	for details of the model.
Index: sansmodels/src/sans/models/OblateModel.py
===================================================================
--- sansmodels/src/sans/models/OblateModel.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
+++ sansmodels/src/sans/models/OblateModel.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -0,0 +1,137 @@
+#!/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\oblate.h
+ 	         AND RE-RUN THE GENERATOR SCRIPT
+
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans_extension.c_models import COblateModel
+import copy    
+    
+class OblateModel(COblateModel, BaseComponent):
+    """ Class that evaluates a OblateModel model. 
+    	This file was auto-generated from ..\c_extensions\oblate.h.
+    	Refer to that file and the structure it contains
+    	for details of the model.
+    	List of default parameters:
+         scale           = 1.0 
+         major_core      = 200.0 [A]
+         minor_core      = 20.0 [A]
+         major_shell     = 250.0 [A]
+         minor_shell     = 30.0 [A]
+         contrast        = 1e-006 [1/A²]
+         sld_solvent     = 6.3e-006 [1/A²]
+         background      = 0.001 [1/cm]
+         axis_theta      = 1.0 [rad]
+         axis_phi        = 1.0 [rad]
+
+    """
+        
+    def __init__(self):
+        """ Initialization """
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        COblateModel.__init__(self)
+        
+        ## Name of the model
+        self.name = "OblateModel"
+        ## Model description
+        self.description ="""[OblateCoreShellModel] Calculates the form factor for an oblate
+		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]:
+		major_core = radius of major_core,
+		minor_core = radius of minor_core,
+		major_shell = radius of major_shell,
+		minor_shell = radius of minor_shell,
+		contrast = SLD_core - 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."""
+       
+		## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['major_core'] = ['[A]', None, None]
+        self.details['minor_core'] = ['[A]', None, None]
+        self.details['major_shell'] = ['[A]', None, None]
+        self.details['minor_shell'] = ['[A]', None, None]
+        self.details['contrast'] = ['[1/A²]', None, None]
+        self.details['sld_solvent'] = ['[1/A²]', 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=['major_core.width', 'minor_core.width', 'major_shell.width', 'minor_shell.width']
+        
+        ## parameters with orientation
+        self.orientation_params =['axis_phi', 'axis_theta', 'axis_phi.width', 'axis_theta.width']
+   
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(OblateModel())   
+   
+    def run(self, x = 0.0):
+        """ Evaluate the model
+            @param x: input q, or [q,phi]
+            @return: scattering function P(q)
+        """
+        
+        return COblateModel.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 COblateModel.runXY(self, x)
+        
+    def evalDistribition(self, x = []):
+        """ Evaluate the model in cartesian coordinates
+            @param x: input q[], or [qx[], qy[]]
+            @return: scattering function P(q[])
+        """
+        return COblateModel.evalDistribition(self, x)
+        
+    def calculate_ER(self):
+        """ Calculate the effective radius for P(q)*S(q)
+            @param x: input q, or [q,phi]
+            @return: the value of the effective radius
+        """       
+        return COblateModel.calculate_ER(self)
+        
+    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 COblateModel.set_dispersion(self, parameter, dispersion.cdisp)
+        
+   
+# End of file
Index: sansmodels/src/sans/models/PorodModel.py
===================================================================
--- sansmodels/src/sans/models/PorodModel.py	(revision 1ed3834d2e968f8ff632d0b368f55ac28174df7a)
+++ sansmodels/src/sans/models/PorodModel.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -11,5 +11,5 @@
     """ Class that evaluates a Porod model.
     
-       I(q) = scale/q^4
+       I(q) = scale/q^4 +background
         
     """
@@ -29,5 +29,5 @@
         self.params['background'] = 0.0
         self.description= """The Porod model.
-        I(q) = scale/q^4"""
+        I(q) = scale/q^4 +background"""
 
         ## Parameter details [units, min, max]
Index: sansmodels/src/sans/models/PowerLawAbsModel.py
===================================================================
--- sansmodels/src/sans/models/PowerLawAbsModel.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
+++ sansmodels/src/sans/models/PowerLawAbsModel.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+""" 
+    Provide F(x) = scale* (|x|)^(-m) + bkd
+    Power law function as a BaseComponent model
+"""
+
+from sans.models.PowerLawModel import PowerLawModel
+import math
+class PowerLawAbsModel(PowerLawModel):
+    """
+        Class that evaluates a absolute Power_Law model.
+        
+        F(x) = scale* (|x|)^(-m) + bkd
+        
+        The model has three parameters: 
+            m     =  power
+            scale  =  scale factor
+            bkd    =  incoherent background
+    """
+    
+    def __init__(self):
+        """ Initialization """
+        # Initialize PowerLawAbsModel 
+        PowerLawModel.__init__(self)
+        ## Name of the model
+        self.name = "Absolute Power_Law"
+        self.description=""" The Power_Law model.
+        F(x) = scale* (|x|)^(-m) + bkd
+        
+        The model has three parameters: 
+        m     =  power
+        scale  =  scale factor
+        bkd    =  incoherent background"""
+        
+        
+    def _PowerLaw(self, x):
+        return PowerLawModel._PowerLaw(self, math.fabs(x))
+       
Index: sansmodels/src/sans/models/PowerLawModel.py
===================================================================
--- sansmodels/src/sans/models/PowerLawModel.py	(revision 1ed3834d2e968f8ff632d0b368f55ac28174df7a)
+++ sansmodels/src/sans/models/PowerLawModel.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -36,5 +36,5 @@
         self.params['background']   = 0.0
         self.description=""" The Power_Law model.
-        F(x) = scale* (|x|)^(-m) + bkd
+        F(x) = scale* (x)^(-m) + bkd
         
         The model has three parameters: 
@@ -51,5 +51,5 @@
     def _PowerLaw(self, x):
         """
-            Evaluate  F(x) = scale* (|x|)^(-m) + bkd
+            Evaluate  F(x) = scale* (x)^(-m) + bkd
            
         """
Index: sansmodels/src/sans/models/ProlateModel.py
===================================================================
--- sansmodels/src/sans/models/ProlateModel.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
+++ sansmodels/src/sans/models/ProlateModel.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -0,0 +1,133 @@
+#!/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\prolate.h
+ 	         AND RE-RUN THE GENERATOR SCRIPT
+
+"""
+
+from sans.models.BaseComponent import BaseComponent
+from sans_extension.c_models import CProlateModel
+import copy    
+    
+class ProlateModel(CProlateModel, BaseComponent):
+    """ Class that evaluates a ProlateModel model. 
+    	This file was auto-generated from ..\c_extensions\prolate.h.
+    	Refer to that file and the structure it contains
+    	for details of the model.
+    	List of default parameters:
+         scale           = 1.0 
+         major_core      = 100.0 [A]
+         minor_core      = 50.0 [A]
+         major_shell     = 110.0 [A]
+         minor_shell     = 60.0 [A]
+         contrast        = 1e-006 [1/A²]
+         sld_solvent     = 6.3e-006 [1/A²]
+         background      = 0.001 [1/cm]
+
+    """
+        
+    def __init__(self):
+        """ Initialization """
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        CProlateModel.__init__(self)
+        
+        ## Name of the model
+        self.name = "ProlateModel"
+        ## Model description
+        self.description ="""[ProlateCoreShellModel] Calculates the form factor for a prolate
+		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]:
+		major_core = radius of major_core,
+		minor_core = radius of minor_core,
+		major_shell = radius of major_shell,
+		minor_shell = radius of minor_shell,
+		contrast = SLD_core - 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."""
+       
+		## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['major_core'] = ['[A]', None, None]
+        self.details['minor_core'] = ['[A]', None, None]
+        self.details['major_shell'] = ['[A]', None, None]
+        self.details['minor_shell'] = ['[A]', None, None]
+        self.details['contrast'] = ['[1/A²]', None, None]
+        self.details['sld_solvent'] = ['[1/A²]', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+		## fittable parameters
+        self.fixed=['major_core.width', 'minor_core.width', 'major_shell.width', 'minor_shell.width']
+        
+        ## parameters with orientation
+        self.orientation_params =[]
+   
+    def clone(self):
+        """ Return a identical copy of self """
+        return self._clone(ProlateModel())   
+   
+    def run(self, x = 0.0):
+        """ Evaluate the model
+            @param x: input q, or [q,phi]
+            @return: scattering function P(q)
+        """
+        
+        return CProlateModel.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 CProlateModel.runXY(self, x)
+        
+    def evalDistribition(self, x = []):
+        """ Evaluate the model in cartesian coordinates
+            @param x: input q[], or [qx[], qy[]]
+            @return: scattering function P(q[])
+        """
+        return CProlateModel.evalDistribition(self, x)
+        
+    def calculate_ER(self):
+        """ Calculate the effective radius for P(q)*S(q)
+            @param x: input q, or [q,phi]
+            @return: the value of the effective radius
+        """       
+        return CProlateModel.calculate_ER(self)
+        
+    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 CProlateModel.set_dispersion(self, parameter, dispersion.cdisp)
+        
+   
+# End of file
Index: sansmodels/src/sans/models/SquareWellStructure.py
===================================================================
--- sansmodels/src/sans/models/SquareWellStructure.py	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/SquareWellStructure.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -17,5 +17,5 @@
 
 	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\squarewell.h
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\SquareWell.h
  	         AND RE-RUN THE GENERATOR SCRIPT
 
@@ -28,5 +28,5 @@
 class SquareWellStructure(CSquareWellStructure, BaseComponent):
     """ Class that evaluates a SquareWellStructure model. 
-    	This file was auto-generated from ..\c_extensions\squarewell.h.
+    	This file was auto-generated from ..\c_extensions\SquareWell.h.
     	Refer to that file and the structure it contains
     	for details of the model.
Index: sansmodels/src/sans/models/StickyHSStructure.py
===================================================================
--- sansmodels/src/sans/models/StickyHSStructure.py	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/StickyHSStructure.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -17,5 +17,5 @@
 
 	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\stickyHS.h
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\StickyHS.h
  	         AND RE-RUN THE GENERATOR SCRIPT
 
@@ -28,5 +28,5 @@
 class StickyHSStructure(CStickyHSStructure, BaseComponent):
     """ Class that evaluates a StickyHSStructure model. 
-    	This file was auto-generated from ..\c_extensions\stickyHS.h.
+    	This file was auto-generated from ..\c_extensions\StickyHS.h.
     	Refer to that file and the structure it contains
     	for details of the model.
Index: sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -18,5 +18,5 @@
  *
  * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- *          DO NOT MODIFY THIS FILE, MODIFY binaryHS.h
+ *          DO NOT MODIFY THIS FILE, MODIFY binaryHs.h
  *          AND RE-RUN THE GENERATOR SCRIPT
  *
@@ -33,5 +33,5 @@
 #include <math.h>
 #include <time.h>
-#include "binaryHS.h"
+#include "binaryHs.h"
 }
 
@@ -192,6 +192,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -206,6 +206,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -192,6 +192,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -206,6 +206,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CCoreShellCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCoreShellCylinderModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CCoreShellCylinderModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -203,6 +203,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -217,6 +217,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CCoreShellEllipsoidModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCoreShellEllipsoidModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CCoreShellEllipsoidModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -206,6 +206,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -220,6 +220,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CCoreShellModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCoreShellModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CCoreShellModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -191,6 +191,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -205,6 +205,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CCylinderModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CCylinderModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -197,6 +197,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -211,6 +211,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CDiamCylFunc.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CDiamCylFunc.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CDiamCylFunc.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -186,6 +186,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -200,6 +200,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CDiamEllipFunc.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CDiamEllipFunc.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CDiamEllipFunc.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -186,6 +186,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -200,6 +200,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -197,6 +197,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -211,6 +211,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -205,6 +205,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -219,6 +219,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CFlexibleCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CFlexibleCylinderModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CFlexibleCylinderModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -193,6 +193,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -207,6 +207,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CGaussian.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CGaussian.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CGaussian.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -181,6 +181,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -195,6 +195,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CHardsphereStructure.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CHardsphereStructure.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CHardsphereStructure.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -18,5 +18,5 @@
  *
  * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- *          DO NOT MODIFY THIS FILE, MODIFY hardsphere.h
+ *          DO NOT MODIFY THIS FILE, MODIFY Hardsphere.h
  *          AND RE-RUN THE GENERATOR SCRIPT
  *
@@ -33,5 +33,5 @@
 #include <math.h>
 #include <time.h>
-#include "hardsphere.h"
+#include "Hardsphere.h"
 }
 
@@ -183,6 +183,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -197,6 +197,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CHayterMSAStructure.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CHayterMSAStructure.cpp	(revision 42ae1d9f2dd771551fc069abe53a2638ffcba952)
+++ sansmodels/src/sans/models/c_models/CHayterMSAStructure.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -187,6 +187,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -201,6 +201,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -201,6 +201,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -215,6 +215,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CLamellarFFHGModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -191,6 +191,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -205,6 +205,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CLamellarModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CLamellarModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -186,6 +186,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -200,6 +200,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CLamellarPSHGModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarPSHGModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CLamellarPSHGModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -197,6 +197,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -211,6 +211,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CLamellarPSModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLamellarPSModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CLamellarPSModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -191,6 +191,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -205,6 +205,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CLogNormal.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLogNormal.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CLogNormal.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -18,5 +18,5 @@
  *
  * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- *          DO NOT MODIFY THIS FILE, MODIFY lognormal.h
+ *          DO NOT MODIFY THIS FILE, MODIFY logNormal.h
  *          AND RE-RUN THE GENERATOR SCRIPT
  *
@@ -33,5 +33,5 @@
 #include <math.h>
 #include <time.h>
-#include "lognormal.h"
+#include "logNormal.h"
 }
 
@@ -181,6 +181,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -195,6 +195,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CLorentzian.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CLorentzian.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CLorentzian.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -181,6 +181,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -195,6 +195,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CMultiShellModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CMultiShellModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CMultiShellModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -195,6 +195,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -209,6 +209,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/COblateModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/COblateModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
+++ sansmodels/src/sans/models/c_models/COblateModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -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
+ */
+
+/** COblateModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY oblate.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 "oblate.h"
+}
+
+#include "models.hh"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * COblateModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    OblateModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} COblateModel;
+
+
+static void
+COblateModel_dealloc(COblateModel* self)
+{
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+COblateModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    COblateModel *self;
+    
+    self = (COblateModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+COblateModel_init(COblateModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+        self->model = new OblateModel();
+        
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"major_core",Py_BuildValue("d",200.000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"minor_core",Py_BuildValue("d",20.000000));
+        PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006));
+        PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000));
+        PyDict_SetItemString(self->params,"major_shell",Py_BuildValue("d",250.000000));
+        PyDict_SetItemString(self->params,"contrast",Py_BuildValue("d",0.000001));
+        PyDict_SetItemString(self->params,"minor_shell",Py_BuildValue("d",30.000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->major_core.dispersion->accept_as_source(visitor, self->model->major_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "major_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->minor_core.dispersion->accept_as_source(visitor, self->model->minor_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "minor_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->major_shell.dispersion->accept_as_source(visitor, self->model->major_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "major_shell", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->minor_shell.dispersion->accept_as_source(visitor, self->model->minor_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "minor_shell", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static PyMemberDef COblateModel_members[] = {
+    {"params", T_OBJECT, offsetof(COblateModel, params), 0,
+     "Parameters"},
+	{"dispersion", T_OBJECT, offsetof(COblateModel, dispersion), 0,
+	  "Dispersion parameters"},     
+    {"log", T_OBJECT, offsetof(COblateModel, log), 0,
+     "Log"},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double COblateModel_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(OblateModel* 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;
+	}
+	 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( OblateModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int i,j, x_len, y_len, dims[2];
+    //check validity of input vectors
+    if (x->nd != 2 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 2 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[1] != 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[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(2,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+        for ( j=0; j< y_len; j++) {
+            for ( i=0; i< x_len; i++) {
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
+      			double *result_value = (double *)(result->data +
+      			      j*result->strides[0] + i*result->strides[1]);
+      			*result_value = (*model)(x_value, y_value);
+            }           
+        }
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(COblateModelError, 
+                   "COblateModel.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(COblateModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.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(COblateModelError, 
+	    	"COblateModel.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(COblateModelError, 
+                   "COblateModel.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(COblateModelError, 
+	    		"COblateModel.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(COblateModelError, 
+                   "COblateModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(COblateModelError, 
+                   "COblateModel.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(COblateModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.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(COblateModelError, 
+	    	"COblateModel.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(COblateModelError, 
+	    		"COblateModel.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 = COblateModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = COblateModel_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 = COblateModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(COblateModel *self) {
+
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(COblateModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.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(COblateModelError, 
+	    	"COblateModel.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(COblateModelError, 
+	    		"COblateModel.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 = COblateModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = COblateModel_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 = COblateModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(COblateModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(COblateModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(COblateModelError,
+	    	"COblateModel.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, "major_core")) {
+        self->model->major_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "minor_core")) {
+        self->model->minor_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "major_shell")) {
+        self->model->major_shell.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "minor_shell")) {
+        self->model->minor_shell.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(COblateModelError,
+	    	"COblateModel.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 COblateModel_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"},
+      
+    {"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 COblateModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "COblateModel",             /*tp_name*/
+    sizeof(COblateModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)COblateModel_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*/
+    "COblateModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    COblateModel_methods,             /* tp_methods */
+    COblateModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)COblateModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    COblateModel_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 addCOblateModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&COblateModelType) < 0)
+        return;
+
+    Py_INCREF(&COblateModelType);
+    PyModule_AddObject(module, "COblateModel", (PyObject *)&COblateModelType);
+    
+    d = PyModule_GetDict(module);
+    COblateModelError = PyErr_NewException("COblateModel.error", NULL, NULL);
+    PyDict_SetItemString(d, "COblateModelError", COblateModelError);
+}
+
Index: sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CParallelepipedModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -205,6 +205,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -219,6 +219,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CProlateModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CProlateModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
+++ sansmodels/src/sans/models/c_models/CProlateModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -0,0 +1,605 @@
+/**
+	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
+ */
+
+/** CProlateModel
+ *
+ * C extension 
+ *
+ * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
+ *          DO NOT MODIFY THIS FILE, MODIFY prolate.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 "prolate.h"
+}
+
+#include "models.hh"
+#include "dispersion_visitor.hh"
+
+/// Error object for raised exceptions
+static PyObject * CProlateModelError = NULL;
+
+
+// Class definition
+typedef struct {
+    PyObject_HEAD
+    /// Parameters
+    PyObject * params;
+    /// Dispersion parameters
+    PyObject * dispersion;
+    /// Underlying model object
+    ProlateModel * model;
+    /// Log for unit testing
+    PyObject * log;
+} CProlateModel;
+
+
+static void
+CProlateModel_dealloc(CProlateModel* self)
+{
+    self->ob_type->tp_free((PyObject*)self);
+    
+
+}
+
+static PyObject *
+CProlateModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+    CProlateModel *self;
+    
+    self = (CProlateModel *)type->tp_alloc(type, 0);
+   
+    return (PyObject *)self;
+}
+
+static int
+CProlateModel_init(CProlateModel *self, PyObject *args, PyObject *kwds)
+{
+    if (self != NULL) {
+    	
+    	// Create parameters
+        self->params = PyDict_New();
+        self->dispersion = PyDict_New();
+        self->model = new ProlateModel();
+        
+        // Initialize parameter dictionary
+        PyDict_SetItemString(self->params,"major_core",Py_BuildValue("d",100.000000));
+        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000));
+        PyDict_SetItemString(self->params,"minor_core",Py_BuildValue("d",50.000000));
+        PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006));
+        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000));
+        PyDict_SetItemString(self->params,"major_shell",Py_BuildValue("d",110.000000));
+        PyDict_SetItemString(self->params,"contrast",Py_BuildValue("d",0.000001));
+        PyDict_SetItemString(self->params,"minor_shell",Py_BuildValue("d",60.000000));
+        // Initialize dispersion / averaging parameter dict
+        DispersionVisitor* visitor = new DispersionVisitor();
+        PyObject * disp_dict;
+        disp_dict = PyDict_New();
+        self->model->major_core.dispersion->accept_as_source(visitor, self->model->major_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "major_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->minor_core.dispersion->accept_as_source(visitor, self->model->minor_core.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "minor_core", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->major_shell.dispersion->accept_as_source(visitor, self->model->major_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "major_shell", disp_dict);
+        disp_dict = PyDict_New();
+        self->model->minor_shell.dispersion->accept_as_source(visitor, self->model->minor_shell.dispersion, disp_dict);
+        PyDict_SetItemString(self->dispersion, "minor_shell", disp_dict);
+
+
+         
+        // Create empty log
+        self->log = PyDict_New();
+        
+        
+
+    }
+    return 0;
+}
+
+static PyMemberDef CProlateModel_members[] = {
+    {"params", T_OBJECT, offsetof(CProlateModel, params), 0,
+     "Parameters"},
+	{"dispersion", T_OBJECT, offsetof(CProlateModel, dispersion), 0,
+	  "Dispersion parameters"},     
+    {"log", T_OBJECT, offsetof(CProlateModel, log), 0,
+     "Log"},
+    {NULL}  /* Sentinel */
+};
+
+/** Read double from PyObject
+    @param p PyObject
+    @return double
+*/
+double CProlateModel_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(ProlateModel* 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;
+	}
+	 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( ProlateModel* model, 
+                              PyArrayObject *x, PyArrayObject *y)
+ {
+    PyArrayObject *result;
+    int i,j, x_len, y_len, dims[2];
+    //check validity of input vectors
+    if (x->nd != 2 || x->descr->type_num != PyArray_DOUBLE
+        || y->nd != 2 || y->descr->type_num != PyArray_DOUBLE
+        || y->dimensions[1] != 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[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
+	    
+	    // Make a new double matrix of same dims
+        result=(PyArrayObject *) PyArray_FromDims(2,dims,NPY_DOUBLE);
+        if (result == NULL){
+	    const char * message= "Could not create result ";
+        PyErr_SetString(PyExc_RuntimeError , message);
+	    return NULL;
+	    }
+       
+        /* Do the calculation. */
+        for ( j=0; j< y_len; j++) {
+            for ( i=0; i< x_len; i++) {
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
+      			double *result_value = (double *)(result->data +
+      			      j*result->strides[0] + i*result->strides[1]);
+      			*result_value = (*model)(x_value, y_value);
+            }           
+        }
+        return PyArray_Return(result); 
+        
+        }else{
+		    PyErr_SetString(CProlateModelError, 
+                   "CProlateModel.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(CProlateModel *self, PyObject *args){
+	PyObject *qx, *qy;
+	PyArrayObject * pars;
+	int npars ,mpars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.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(CProlateModelError, 
+	    	"CProlateModel.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(CProlateModelError, 
+                   "CProlateModel.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(CProlateModelError, 
+	    		"CProlateModel.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(CProlateModelError, 
+                   "CProlateModel.evalDistribution expect 2 numpy arrays in list.");
+	        return NULL;
+	     }
+	}
+	PyErr_SetString(CProlateModelError, 
+                   "CProlateModel.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(CProlateModel *self, PyObject *args) {
+	double q_value, phi_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.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(CProlateModelError, 
+	    	"CProlateModel.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(CProlateModelError, 
+	    		"CProlateModel.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 = CProlateModel_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = CProlateModel_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 = CProlateModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(q_value));
+	}	
+}
+/**
+ * Function to call to calculate_ER
+ * @return: effective radius value 
+ */
+static PyObject * calculate_ER(CProlateModel *self) {
+
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.dispersion, disp_dict);
+
+		
+	return Py_BuildValue("d",(*(self->model)).calculate_ER());
+
+}
+/**
+ * Function to call to evaluate model in cartesian coordinates
+ * @param args: input q or [qx, qy]]
+ * @return: function value
+ */
+static PyObject * runXY(CProlateModel *self, PyObject *args) {
+	double qx_value, qy_value;
+	PyObject* pars;
+	int npars;
+	
+	// Get parameters
+	
+	    // Reader parameter dictionary
+    self->model->major_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_core") );
+    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") );
+    self->model->minor_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_core") );
+    self->model->sld_solvent = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solvent") );
+    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") );
+    self->model->major_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "major_shell") );
+    self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") );
+    self->model->minor_shell = PyFloat_AsDouble( PyDict_GetItemString(self->params, "minor_shell") );
+    // Read in dispersion parameters
+    PyObject* disp_dict;
+    DispersionVisitor* visitor = new DispersionVisitor();
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_core");
+    self->model->major_core.dispersion->accept_as_destination(visitor, self->model->major_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_core");
+    self->model->minor_core.dispersion->accept_as_destination(visitor, self->model->minor_core.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "major_shell");
+    self->model->major_shell.dispersion->accept_as_destination(visitor, self->model->major_shell.dispersion, disp_dict);
+    disp_dict = PyDict_GetItemString(self->dispersion, "minor_shell");
+    self->model->minor_shell.dispersion->accept_as_destination(visitor, self->model->minor_shell.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(CProlateModelError, 
+	    	"CProlateModel.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(CProlateModelError, 
+	    		"CProlateModel.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 = CProlateModel_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = CProlateModel_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 = CProlateModel_readDouble(pars);		
+		
+		return Py_BuildValue("d",(*(self->model))(qx_value));
+	}	
+}
+
+static PyObject * reset(CProlateModel *self, PyObject *args) {
+    
+
+    return Py_BuildValue("d",0.0);
+}
+
+static PyObject * set_dispersion(CProlateModel *self, PyObject *args) {
+	PyObject * disp;
+	const char * par_name;
+
+	if ( !PyArg_ParseTuple(args,"sO", &par_name, &disp) ) {
+	    PyErr_SetString(CProlateModelError,
+	    	"CProlateModel.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, "major_core")) {
+        self->model->major_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "minor_core")) {
+        self->model->minor_core.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "major_shell")) {
+        self->model->major_shell.dispersion = dispersion;
+    } else    if (!strcmp(par_name, "minor_shell")) {
+        self->model->minor_shell.dispersion = dispersion;
+    } else {
+	    PyErr_SetString(CProlateModelError,
+	    	"CProlateModel.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 CProlateModel_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"},
+      
+    {"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 CProlateModelType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CProlateModel",             /*tp_name*/
+    sizeof(CProlateModel),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CProlateModel_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*/
+    "CProlateModel objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CProlateModel_methods,             /* tp_methods */
+    CProlateModel_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CProlateModel_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CProlateModel_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 addCProlateModel(PyObject *module) {
+	PyObject *d;
+	
+    if (PyType_Ready(&CProlateModelType) < 0)
+        return;
+
+    Py_INCREF(&CProlateModelType);
+    PyModule_AddObject(module, "CProlateModel", (PyObject *)&CProlateModelType);
+    
+    d = PyModule_GetDict(module);
+    CProlateModelError = PyErr_NewException("CProlateModel.error", NULL, NULL);
+    PyDict_SetItemString(d, "CProlateModelError", CProlateModelError);
+}
+
Index: sansmodels/src/sans/models/c_models/CSchulz.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CSchulz.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CSchulz.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -181,6 +181,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -195,6 +195,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CSphereModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CSphereModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CSphereModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -185,6 +185,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -199,6 +199,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CSquareWellStructure.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CSquareWellStructure.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CSquareWellStructure.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -18,5 +18,5 @@
  *
  * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- *          DO NOT MODIFY THIS FILE, MODIFY squarewell.h
+ *          DO NOT MODIFY THIS FILE, MODIFY SquareWell.h
  *          AND RE-RUN THE GENERATOR SCRIPT
  *
@@ -33,5 +33,5 @@
 #include <math.h>
 #include <time.h>
-#include "squarewell.h"
+#include "SquareWell.h"
 }
 
@@ -185,6 +185,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -199,6 +199,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CStackedDisksModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -205,6 +205,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -219,6 +219,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CStickyHSStructure.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CStickyHSStructure.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CStickyHSStructure.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -18,5 +18,5 @@
  *
  * WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- *          DO NOT MODIFY THIS FILE, MODIFY stickyHS.h
+ *          DO NOT MODIFY THIS FILE, MODIFY StickyHS.h
  *          AND RE-RUN THE GENERATOR SCRIPT
  *
@@ -33,5 +33,5 @@
 #include <math.h>
 #include <time.h>
-#include "stickyHS.h"
+#include "StickyHS.h"
 }
 
@@ -185,6 +185,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -199,6 +199,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -196,6 +196,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -210,6 +210,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/CVesicleModel.cpp
===================================================================
--- sansmodels/src/sans/models/c_models/CVesicleModel.cpp	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/CVesicleModel.cpp	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -190,6 +190,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -204,6 +204,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/classTemplate.txt
===================================================================
--- sansmodels/src/sans/models/c_models/classTemplate.txt	(revision 5eb91544a3ee42b368ccec3ebcf8e95f75b020a2)
+++ sansmodels/src/sans/models/c_models/classTemplate.txt	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -171,6 +171,6 @@
 	if (PyArray_Check(x) && PyArray_Check(y)) {
 		
-	    x_len = dims[1]= x->dimensions[0];
-        y_len = dims[0]= y->dimensions[1];
+	    x_len = dims[1]= x->dimensions[1];
+        y_len = dims[0]= y->dimensions[0];
 	    
 	    // Make a new double matrix of same dims
@@ -185,6 +185,6 @@
         for ( j=0; j< y_len; j++) {
             for ( i=0; i< x_len; i++) {
-                double x_value = *(double *)(x->data + i*x->strides[0]);
-      		    double y_value = *(double *)(y->data + j*y->strides[1]);
+                double x_value = *(double *)(x->data + i*x->strides[1]);
+      		    double y_value = *(double *)(y->data + j*y->strides[0]);
       			double *result_value = (double *)(result->data +
       			      j*result->strides[0] + i*result->strides[1]);
Index: sansmodels/src/sans/models/c_models/wrapping.py
===================================================================
--- sansmodels/src/sans/models/c_models/wrapping.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
+++ sansmodels/src/sans/models/c_models/wrapping.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -0,0 +1,23 @@
+import sys
+import os
+import os.path
+from WrapperGenerator import WrapperGenerator
+
+
+root= os.path.dirname(os.getcwd())
+
+dir = os.path.join(root, "c_extensions")
+#print "dir", dir
+list= os.listdir(dir)
+nModels=0
+for item in list:
+    toks = os.path.splitext(os.path.basename(item))
+    if toks[1]=='.h':
+        nModels += 1
+        name = toks[0]
+        app = WrapperGenerator(os.path.join('..','c_extensions',name+".h"))
+        app.read()
+        app.write_c_wrapper()
+        app.write_python_wrapper()
+        print app
+print "Number total of models is %s"%nModels
Index: sansmodels/src/sans/models/test/TriaxialEllipsoidModel_avg.txt
===================================================================
--- sansmodels/src/sans/models/test/TriaxialEllipsoidModel_avg.txt	(revision 861a2d319586bc15dff1cc29da8013efd2e2df76)
+++ sansmodels/src/sans/models/test/TriaxialEllipsoidModel_avg.txt	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -22,19 +22,2 @@
       0.21   0.352447    0.35239
       0.22   0.318321   0.319034
-      0.23   0.286235    0.28683
-      0.24   0.253276   0.253296
-      0.25   0.215823   0.216689
-      0.26   0.175608   0.176596
-      0.27   0.142021   0.141555
-      0.28   0.117013   0.115955
-      0.29   0.097918  0.0978735
-       0.3  0.0857748  0.0869363
-      0.31  0.0797341  0.0810271
-      0.32  0.0751376   0.075475
-      0.33   0.069484  0.0688126
-      0.34  0.0623802  0.0614295
-      0.35  0.0534721  0.0530275
-      0.36  0.0443903  0.0448143
-      0.37  0.0376499  0.0384918
-      0.38  0.0332545  0.0339966
-      0.39   0.030798   0.031047
Index: sansmodels/src/sans/models/test/utest_models.py
===================================================================
--- sansmodels/src/sans/models/test/utest_models.py	(revision 26e4a247fb629283560bcebfc702766d91e89b16)
+++ sansmodels/src/sans/models/test/utest_models.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -24,9 +24,9 @@
     def test1D(self):
         """ Test 1D model for a sphere """
-        self.assertAlmostEqual(self.comp.run(1.0), 56.3878, 4)
+        self.assertAlmostEqual(self.comp.run(1.0), 5.6387e-5, 4)
         
     def test1D_2(self):
         """ Test 2D model for a sphere """
-        self.assertAlmostEqual(self.comp.run([1.0, 1.3]), 56.3878, 4)
+        self.assertAlmostEqual(self.comp.run([1.0, 1.3]), 5.6387e-5, 4)
 
 class TestCyl(unittest.TestCase):
Index: sansmodels/src/sans/models/test/utest_other_models.py
===================================================================
--- sansmodels/src/sans/models/test/utest_other_models.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
+++ sansmodels/src/sans/models/test/utest_other_models.py	(revision 9ce41c6f9cb652f9c0a81a779f2dd143382ac661)
@@ -0,0 +1,1584 @@
+"""
+    Unit tests for specific models.
+    @since: 08/25/2009 
+    @note:  The models are running also with numpy array as input.
+            Some models return limit of the function at critical point .
+            So the user should expect finite value for some critical points.
+            Initial values for models are given as the one of Igo software.
+    @author: Gervaise Alina / UTK
+"""
+
+import unittest
+import numpy 
+import math
+
+class TestCoreShell(unittest.TestCase):
+    """ Unit tests for coreshell model """
+    
+    def setUp(self):
+        from sans.models.CoreShellModel import CoreShellModel
+        self.comp = CoreShellModel()
+        #Give initial value to model
+        self.comp.setParam("scale", 1.0)
+        self.comp.setParam("radius", 60.0)
+        self.comp.setParam("thickness", 10.0)
+        self.comp.setParam("core_sld", 1.0e-6)
+        self.comp.setParam("shell_sld",2.0e-6)
+        self.comp.setParam("solvent_sld",3.0e-6)
+        self.comp.setParam("Background", 0.001)
+   
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a coreshell """
+        self.assertAlmostEquals(self.comp.run(0.4),0.00169, 4)
+        
+    def test1D_2(self):
+        """ Test 2D model for a coreshell """
+        self.assertAlmostEquals(self.comp.run([0.4, 1.3]),0.00169, 4)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a coreshell  with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a coreshell  with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+        
+        
+  
+class TestMultiShellModel(unittest.TestCase):
+    """ Unit tests for MultiShell Model """
+    
+    def setUp(self):
+        from sans.models.MultiShellModel import MultiShellModel
+        self.comp = MultiShellModel()
+        #Give initial value to model
+        self.comp.setParam("scale", 1.0)
+        self.comp.setParam("core_radius", 60.0)
+        self.comp.setParam("s_thickness", 10.0)
+        self.comp.setParam("w_thickness",10.0 )
+        self.comp.setParam("core_sld",6.4e-6)
+        self.comp.setParam("shell_sld",4e-7)
+        self.comp.setParam("n_pairs", 2)
+        self.comp.setParam("Background", 0.001)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a MultiShell Model """
+        self.assertAlmostEquals(self.comp.run(0.001), 2442.81, 2)
+        
+    def test1D_2(self):
+        """ Test 2D model for a MultiShell Model"""
+        self.assertAlmostEquals(self.comp.run([0.001, 0.30903]), 2442.81, 2)
+      
+    def testEval_1D(self):
+        """ Test 1D model for a MultiShell  with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a MultiShell  with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+    
+    
+class TestVesicleModel(unittest.TestCase):
+    """ Unit tests for Vesicle Model """
+    
+    def setUp(self):
+        from sans.models.VesicleModel import VesicleModel
+        self.comp = VesicleModel()
+        #Give initial value to model
+        self.comp.setParam("scale", 1.0)
+        self.comp.setParam("radius", 100.0)
+        self.comp.setParam("core_sld", 6.36e-6)
+        self.comp.setParam("shell_sld",5e-7)
+        self.comp.setParam("thickness",30.0 )
+        self.comp.setParam("Background", 0.001)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a Vesicle Model """
+        self.assertAlmostEquals(self.comp.run(0.001), 1.71399e4,1)
+        
+    def test1D_2(self):
+        """ Test 2D model for a Vesicle Model"""
+        self.assertAlmostEquals(self.comp.run([0.001, 1.3]), 1.71399e4,1)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a Vesicle with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a Vesicle with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+    
+      
+class TestBinaryHSModel(unittest.TestCase):
+    """ Unit tests for BinaryHS Model"""
+    
+    def setUp(self):
+        from sans.models.BinaryHSModel import BinaryHSModel
+        self.comp = BinaryHSModel()
+        #Give initial value to model
+        self.comp.setParam("l_radius", 100.0)
+        self.comp.setParam("ls_sld", 3.5e-6)
+        self.comp.setParam("s_radius",25)
+        self.comp.setParam("solvent_sld",6.36e-6 )
+        self.comp.setParam("ss_sld", 5e-7)
+        self.comp.setParam("vol_frac_ss", 0.1)
+        self.comp.setParam("vol_frac_ls", 0.2)
+        self.comp.setParam("Background", 0.001)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a BinaryHS Model"""
+        self.assertAlmostEquals(self.comp.run(0.001),60.6785, 4)
+        
+    def test1D_2(self):
+        """ Test 2D model for a BinaryHS Model"""
+        self.assertAlmostEquals(self.comp.run([0.001, 1.3]),60.6785, 4)
+      
+    def testEval_1D(self):
+        """ Test 1D model for a BinaryHS with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a BinaryHS with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+     
+     
+class TestCoreShellCylinderModel(unittest.TestCase):
+    """ Unit tests for CoreShellCylinder Model"""
+    
+    def setUp(self):
+        from sans.models.CoreShellCylinderModel import CoreShellCylinderModel
+        self.comp = CoreShellCylinderModel()
+        #Give initial value to model
+        self.comp.setParam("scale", 1.0)
+        self.comp.setParam("core_sld", 1e-6)
+        self.comp.setParam("length", 400)
+        self.comp.setParam("radius",20)
+        self.comp.setParam("solvent_sld",1e-6 )
+        self.comp.setParam("shell_sld", 4e-6)
+        self.comp.setParam("thickness", 10.0)
+        self.comp.setParam("Background", 0.01)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        self.q = 0.001
+        self.phi= math.pi/2
+        self.qx= self.q*math.cos(self.phi)
+        self.qy= self.q*math.sin(self.phi)
+        
+    def test1D(self):
+        """ Test 1D model for a CoreShellCylinder Model"""
+        self.assertAlmostEqual(self.comp.run(0.001), 353.56,1)
+        
+    def test1D_2(self):
+        """ Test 2D model for a CoreShellCylinder Model"""
+        self.assertAlmostEqual(self.comp.run([self.q, self.phi]), 
+                              self.comp.runXY([self.qx, self.qy]),1)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a CoreShellCylinder with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a CoreShellCylinder with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+ 
+ 
+class TestHollowCylinderModel(unittest.TestCase):
+    """ Unit tests for HollowCylinder Model"""
+    
+    def setUp(self):
+        from sans.models.HollowCylinderModel import HollowCylinderModel
+        self.comp = HollowCylinderModel()
+        #Give initial value to model
+        self.comp.setParam("scale", 1.0)
+        self.comp.setParam("core_radius",20.0)
+        self.comp.setParam("radius",30)
+        self.comp.setParam("length", 400)
+        self.comp.setParam("contrast",5.3e-6 )
+        self.comp.setParam("Background", 0.01)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        self.q = 0.001
+        self.phi= math.pi/2
+        self.qx= self.q*math.cos(self.phi)
+        self.qy= self.q*math.sin(self.phi)
+        
+    def test1D(self):
+        """ Test 1D model for a HollowCylinder Model"""
+        self.assertAlmostEqual(self.comp.run(0.001), 1756.76, 1)
+        
+    def test1D_2(self):
+        """ Test 2D model for a HollowCylinder Model"""
+        self.assertAlmostEqual(self.comp.run([self.q, self.phi]), 
+                              self.comp.runXY([self.qx, self.qy]),1) 
+  
+    def testEval_1D(self):
+        """ Test 1D model for a HollowCylinder with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a HollowCylinder with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+        
+        
+class TestFlexibleCylinderModel(unittest.TestCase):
+    """ Unit tests for FlexibleCylinder Model"""
+    
+    def setUp(self):
+        from sans.models.FlexibleCylinderModel import FlexibleCylinderModel
+        self.comp = FlexibleCylinderModel()
+        #Give initial value to model
+        self.comp.setParam("scale", 1.0)
+        self.comp.setParam("contrast",5.3e-6 )
+        self.comp.setParam("kuhn_length",100)
+        self.comp.setParam("length", 1000)
+        self.comp.setParam("radius",20)
+        self.comp.setParam("Background", 0.0001)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        self.q = 0.001
+        self.phi= math.pi/2
+        self.qx= self.q*math.cos(self.phi)
+        self.qy= self.q*math.sin(self.phi)
+        
+    def test1D(self):
+        """ Test 1D model for a FlexibleCylinder Model"""
+        self.assertAlmostEqual(self.comp.run(0.001), 3509.22, 1)
+        
+    def test1D_2(self):
+        """ Test 2D model for a FlexibleCylinder Model"""
+        self.assertAlmostEqual(self.comp.run([self.q, self.phi]), 
+                              self.comp.runXY([self.qx, self.qy]),1) 
+    def testEval_1D(self):
+        """ Test 1D model for a FlexibleCylinder Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a FlexibleCylinder Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+   
+  
+              
+class TestStackedDisksModel(unittest.TestCase):
+    """ Unit tests for StackedDisks Model"""
+    
+    def setUp(self):
+        from sans.models.StackedDisksModel import StackedDisksModel
+        self.comp = StackedDisksModel()
+        #Give initial value to model
+        self.comp.setParam("scale", 0.01 )
+        self.comp.setParam("radius",3000.0 )
+        self.comp.setParam("core_thick", 10.0)
+        self.comp.setParam("layer_thick",15.0 )
+        self.comp.setParam("core_sld",4e-006 )
+        self.comp.setParam("layer_sld",-4e-007 )
+        self.comp.setParam("solvent_sld", 5e-006 )
+        self.comp.setParam("n_stacking",1.0 )
+        self.comp.setParam("sigma_d", 0.0)
+        self.comp.setParam("background",0.001)
+        self.comp.setParam("axis_theta", 0.0 )
+        self.comp.setParam("axis_phi",0.0)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        self.q = 0.001
+        self.phi= math.pi/2
+        self.qx= self.q*math.cos(self.phi)
+        self.qy= self.q*math.sin(self.phi)
+        
+    def test1D(self):
+        """ Test 1D model for a StackedDisks Model"""
+        self.assertAlmostEqual(self.comp.run(0.001), 5075.12, 1)
+        
+    def test1D_2(self):
+        """ Test 2D model for a StackedDisks Model"""
+        self.assertAlmostEqual(self.comp.run([self.q, self.phi]), 
+                              self.comp.runXY([self.qx, self.qy]),1)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a StackedDisks Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a StackedDisks Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+  
+  
+class TestParallelepipedModel(unittest.TestCase):
+    """ Unit tests for Parallelepiped Model"""
+    
+    def setUp(self):
+        from sans.models.ParallelepipedModel import ParallelepipedModel
+        self.comp = ParallelepipedModel()
+        #Give initial value to model
+        self.comp.setParam("background", 0.0 )
+        self.comp.setParam("short_a",35)
+        self.comp.setParam("short_b", 75)
+        self.comp.setParam("long_c",400 )
+        self.comp.setParam("contrast", 5.3e-006 )
+        self.comp.setParam("scale",1.0 )
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        self.q = 0.001
+        self.phi= math.pi/2
+        self.qx= self.q*math.cos(self.phi)
+        self.qy= self.q*math.sin(self.phi)
+        
+    
+    def test1D(self):
+        """ Test 1D model for a Parallelepiped Model"""
+        self.assertAlmostEqual(self.comp.run(0.001), 2935.82, 2)
+        
+    def test1D_2(self):
+        """ Test 2D model for a Parallelepiped Model"""
+        self.assertAlmostEqual(self.comp.run([self.q, self.phi]), 
+                              self.comp.runXY([self.qx, self.qy]),1)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a Parallelepiped Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a Parallelepiped Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+   
+  
+class TestEllipticalCylinderModel(unittest.TestCase):
+    """ Unit tests for EllipticalCylinder Model"""
+    
+    def setUp(self):
+        from sans.models.EllipticalCylinderModel import EllipticalCylinderModel
+        self.comp = EllipticalCylinderModel()
+        self.comp.setParam("scale",1.0) 
+        self.comp.setParam("r_minor",20.0)
+        self.comp.setParam("r_ratio",1.5) 
+        self.comp.setParam("length",400.0)
+        self.comp.setParam("contrast",5.3e-006)
+        self.comp.setParam("background",0.0)
+        self.comp.setParam("cyl_theta",0.0)
+        self.comp.setParam("cyl_phi",0.0)
+        self.comp.setParam("cyl_psi",0.0)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        self.q = 0.001
+        self.phi= math.pi/2
+        self.qx= self.q*math.cos(self.phi)
+        self.qy= self.q*math.sin(self.phi)
+        
+    def test1D(self):
+        """ Test 1D model for a EllipticalCylinder Model"""
+        self.assertAlmostEqual(self.comp.run(0.001),2108.32, 1)
+        
+    def test1D_2(self):
+        """ Test 2D model for a EllipticalCylinder Model"""
+        self.assertAlmostEqual(self.comp.run([self.q, self.phi]), 
+                              self.comp.runXY([self.qx, self.qy]),1)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a EllipticalCylinder with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a EllipticalCylinder with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+        
+  
+        
+class TestEllipsoidModel(unittest.TestCase):
+    """ Unit tests for Ellipsoid Model"""
+    
+    def setUp(self):
+        from sans.models.EllipsoidModel import EllipsoidModel
+        self.comp = EllipsoidModel()
+        self.comp.setParam("scale",1.0) 
+        self.comp.setParam("radius_a",20.0)
+        self.comp.setParam("radius_b",400.0)
+        self.comp.setParam("contrast",3e-006)
+        self.comp.setParam("background",0.0)
+        self.comp.setParam("axis_theta",1.57)
+        self.comp.setParam("axis_phi",0.0)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        self.q = 0.001
+        self.phi= math.pi/2
+        self.qx= self.q*math.cos(self.phi)
+        self.qy= self.q*math.sin(self.phi)
+        
+    def test1D(self):
+        """ Test 1D model for a Ellipsoid Model"""
+        self.assertAlmostEqual(self.comp.run(1.0), 0.000733968, 4)
+        
+    def test1D_2(self):
+        """ Test 2D model for a Ellipsoid Model"""
+        self.assertAlmostEqual(self.comp.run([self.q, self.phi]), 
+                              self.comp.runXY([self.qx, self.qy]),1)
+    def testEval_1D(self):
+        """ Test 1D model for a Ellipsoid Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a Ellipsoid Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+        
+        
+class TestCoreShellEllipsoidModel(unittest.TestCase):
+    """ Unit tests for CoreShellEllipsoid Model"""
+    
+    def setUp(self):
+        from sans.models.CoreShellEllipsoidModel import CoreShellEllipsoidModel
+        self.comp = CoreShellEllipsoidModel()
+        #Give initial value to model
+        self.comp.setParam("scale", 1.0)
+        self.comp.setParam("equat_core", 200.0)
+        self.comp.setParam("polar_core", 20.0)
+        self.comp.setParam("equat_shell",250.0)
+        self.comp.setParam("polar_shell", 30.0)
+        self.comp.setParam("contrast",1e-006)
+        self.comp.setParam("sld_solvent",6.3e-006)
+        self.comp.setParam("background",0.001)
+        self.comp.setParam("axis_theta", 0.0)
+        self.comp.setParam("axis_phi",0.0)
+         
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        self.q = 0.001
+        self.phi= math.pi/2
+        self.qx= self.q*math.cos(self.phi)
+        self.qy= self.q*math.sin(self.phi)
+        
+    def test1D(self):
+        """ Test 1D model for a CoreShellEllipsoid Model"""
+        self.assertAlmostEqual(self.comp.run(1.0), 0.002578943, 4)
+        
+    def test1D_2(self):
+        """ Test 2D model for a CoreShellEllipsoid Model"""
+        self.assertAlmostEqual(self.comp.run([self.q, self.phi]), 
+                              self.comp.runXY([self.qx, self.qy]),1)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a CoreShellEllipsoid with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a CoreShellEllipsoid with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+ 
+    
+class TestTriaxialEllipsoidModel(unittest.TestCase):
+    """ Unit tests for TriaxialEllipsoid Model"""
+    
+    def setUp(self):
+        from sans.models.TriaxialEllipsoidModel import TriaxialEllipsoidModel
+        self.comp = TriaxialEllipsoidModel()
+        self.comp.setParam("scale",1.0)
+        self.comp.setParam("semi_axisA",35.0)
+        self.comp.setParam("semi_axisB", 100.0)
+        self.comp.setParam("semi_axisC",400.0 )
+        self.comp.setParam("contrast",5.3e-6)
+        self.comp.setParam("background",0.0)
+        self.comp.setParam("axis_theta", 1.0)
+        self.comp.setParam("axis_phi",0.0 )
+        self.comp.setParam("axis_psi",0.0 )
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        self.q = 0.001
+        self.phi= math.pi/2
+        self.qx= self.q*math.cos(self.phi)
+        self.qy= self.q*math.sin(self.phi)
+        
+        
+    def test1D(self):
+        """ Test 1D model for a TriaxialEllipsoid Model"""
+        self.assertAlmostEquals(self.comp.run(0.001),16285.6, 1)
+        
+    def test1D_2(self):
+        """ Test 2D model for a TriaxialEllipsoid Model"""
+        self.assertAlmostEqual(self.comp.run([self.q, self.phi]), 
+                              self.comp.runXY([self.qx, self.qy]),1)
+     
+    def testEval_1D(self):
+        """ Test 1D model for a TriaxialEllipsoid Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a TriaxialEllipsoid Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+                     
+   
+class TestLamellarModel(unittest.TestCase):
+    """ Unit tests for Lamellar Model"""
+    
+    def setUp(self):
+        from sans.models.LamellarModel import LamellarModel
+        self.comp = LamellarModel()
+        self.comp.setParam("scale",1.0) 
+        self.comp.setParam("bi_thick",50.0)
+        self.comp.setParam("sld_bi",1e-006)
+        self.comp.setParam("sld_sol",6.3e-006)
+        self.comp.setParam("background",0.0)
+
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a Lamellar Model"""
+        self.assertAlmostEquals(self.comp.run(0.001), 902120)
+        
+    def test1D_2(self):
+        """ Test 2D model for a Lamellar Model"""
+        self.assertAlmostEquals(self.comp.run([0.001, 1.3]),902120)     
+    
+    def testEval_1D(self):
+        """ Test 1D model for a Lamellar Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a Lamellar Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)        
+   
+     
+class TestLamellarFFHGModel(unittest.TestCase):
+    """ Unit tests for LamellarFFHG Model"""
+    
+    def setUp(self):
+        from sans.models.LamellarFFHGModel import LamellarFFHGModel
+        self.comp = LamellarFFHGModel()
+        self.comp.setParam("scale",1.0) 
+        self.comp.setParam("t_length",15.0)
+        self.comp.setParam("h_thickness",10.0)
+        self.comp.setParam("sld_tail",4e-007)
+        self.comp.setParam("sld_head",3e-006)
+        self.comp.setParam("sld_solvent",6e-006)
+        self.comp.setParam("background",0.0)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        
+    def test1D(self):
+        """ Test 1D model for a LamellarFFHG Model"""
+        self.assertAlmostEquals(self.comp.run(0.001),653144)
+        
+    def test1D_2(self):
+        """ Test 2D model for a LamellarFFHG Model"""
+        self.assertAlmostEquals(self.comp.run([0.001, 1.3]),653144)
+    
+    def testEval_1D(self):
+        """ Test 1D model for a LamellarFFHG Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a LamellarFFHG Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)        
+                  
+    
+class TestLamellarPSModel(unittest.TestCase):
+    """ Unit tests for LamellarPS Model"""
+    
+    def setUp(self):
+        from sans.models.LamellarPSModel import LamellarPSModel
+        self.comp = LamellarPSModel()
+        self.comp.setParam("scale",1.0) 
+        self.comp.setParam("spacing",400.0)
+        self.comp.setParam("delta",30.0)
+        self.comp.setParam("contrast",5.3e-006)
+        self.comp.setParam("n_plates",20.0) 
+        self.comp.setParam("caille", 0.1)
+        self.comp.setParam("background",0.0)
+
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        
+    def test1D(self):
+        """ Test 1D model for a LamellarPS Model"""
+        self.assertAlmostEquals(self.comp.run(0.001), 28526.8, 1)
+        
+    def test1D_2(self):
+        """ Test 2D model for a LamellarPS Model"""
+        self.assertAlmostEquals(self.comp.run([0.001, 1.3]),28526.8, 1) 
+    
+    def testEval_1D(self):
+        """ Test 1D model for a LamellarPS Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a LamellarPS Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)        
+            
+     
+     
+class TestLamellarPSHGModel(unittest.TestCase):
+    """ Unit tests for LamellarPSHG Model"""
+    
+    def setUp(self):
+        from sans.models.LamellarPSHGModel import LamellarPSHGModel
+        self.comp = LamellarPSHGModel()
+        self.comp.setParam("scale",1.0)
+        self.comp.setParam("spacing",40.0)
+        self.comp.setParam("deltaT",10.0)
+        self.comp.setParam("deltaH",2.0)
+        self.comp.setParam("sld_tail",4e-7)
+        self.comp.setParam("sld_head",2e-6)
+        self.comp.setParam("sld_solvent",6e-6)
+        self.comp.setParam("n_plates",30)
+        self.comp.setParam("caille",0.001)
+        self.comp.setParam("background",0.001)
+
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a LamellarPSHG Model"""
+        self.assertAlmostEquals(self.comp.run(0.001),6.83139e6, 3)
+        
+    def test1D_2(self):
+        """ Test 2D model for a LamellarPSHG Model"""
+        self.assertAlmostEquals(self.comp.run([0.001, 1.3]),6.83139e6,3)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a LamellarPSHG Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a LamellarPSHG Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)        
+     
+     
+class TestSquareWellStructure(unittest.TestCase):
+    """ Unit tests for SquareWellStructure """
+    
+    def setUp(self):
+        from sans.models.SquareWellStructure import SquareWellStructure
+        self.comp = SquareWellStructure()
+        self.comp.setParam("effect_radius",50.0)
+        self.comp.setParam("volfraction",0.04)
+        self.comp.setParam("welldepth",1.5 )
+        self.comp.setParam("wellwidth",1.2)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        
+    def test1D(self):
+        """ Test 1D model for a SquareWellStructure"""
+        self.assertAlmostEqual(self.comp.run(0.001), 0.976657, 2)
+        
+    def test1D_2(self):
+        """ Test 2D model for a SquareWellStructure"""
+        self.assertAlmostEqual(self.comp.run([0.001, 1.3]),0.9776657,2)     
+    
+    def testEval_1D(self):
+        """ Test 1D model for a SquareWellStructure with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a SquareWellStructure with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+                         
+     
+class TestHardsphereStructure(unittest.TestCase):
+    """ Unit tests for HardsphereStructure"""
+    
+    def setUp(self):
+        from sans.models.HardsphereStructure import HardsphereStructure
+        self.comp = HardsphereStructure()
+        self.comp.setParam("effect_radius",50.0)
+        self.comp.setParam("volfraction", 0.2)
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        
+    def test1D(self):
+        """ Test 1D model for a HardsphereStructure"""
+        self.assertAlmostEqual(self.comp.run(0.001),0.209128, 4)
+        
+    def test1D_2(self):
+        """ Test 2D model for a HardsphereStructure"""
+        self.assertAlmostEqual(self.comp.run([0.001, 1.3]),0.209128, 4)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a HardsphereStructure with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a HardsphereStructure with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+                      
+    
+class TestStickyHSStructure(unittest.TestCase):
+    """ Unit tests for StickyHSStructure"""
+    
+    def setUp(self):
+        from sans.models.StickyHSStructure import StickyHSStructure
+        self.comp = StickyHSStructure()
+        self.comp.setParam("effect_radius",50.0)
+        self.comp.setParam("volfraction",0.1)
+        self.comp.setParam("perturb",0.05)
+        self.comp.setParam("stickiness",0.2)
+
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a StickyHSStructure"""
+        self.assertAlmostEqual(self.comp.run(0.001),1.09718, 4)
+        
+    def test1D_2(self):
+        """ Test 2D model for a StickyHSStructure"""
+        self.assertAlmostEqual(self.comp.run([0.001, 1.3]),1.09718, 4)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a StickyHSStructure with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+        
+    def testEval_2D(self):
+        """ Test 2D model for a StickyHSStructure with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+               
+     
+        
+class TestHayterMSAStructure(unittest.TestCase):
+    """ Unit tests for HayterMSAStructure"""
+    
+    def setUp(self):
+        from sans.models.HayterMSAStructure import HayterMSAStructure
+        self.comp = HayterMSAStructure()
+        self.comp.setParam("effect_radius",20.75)
+        self.comp.setParam("charge",19.0)
+        self.comp.setParam("volfraction",0.0192 )
+        self.comp.setParam("temperature",298)
+        self.comp.setParam("saltconc",0.0)
+        self.comp.setParam("dielectconst",78)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+
+    def test1D(self):
+        """ Test 1D model for a HayterMSAStructure"""
+        self.assertAlmostEqual(self.comp.run(0.001),0.0712928, 4)
+        
+    def test1D_2(self):
+        """ Test 2D model for a HayterMSAStructure"""
+        self.assertAlmostEqual(self.comp.run([0.001, 1.3]),0.0712928, 4) 
+        
+    def testEval_1D(self):
+        """ Test 1D model for a HayterMSAStructure with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a HayterMSAStructure with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+                       
+     
+     
+class TestBEPolyelectrolyte(unittest.TestCase):
+    """ Unit tests for BEPolyelectrolyte"""
+    
+    def setUp(self):
+        from sans.models.BEPolyelectrolyte import BEPolyelectrolyte
+        self.comp = BEPolyelectrolyte()
+       
+        self.comp.setParam('k',10)
+        self.comp.setParam('lb',7.1)
+        self.comp.setParam('h',12)
+        self.comp.setParam('b',10)
+        self.comp.setParam('cs', 0.0)
+        self.comp.setParam('alpha',0.05)
+        self.comp.setParam('c', 0.7)
+        self.comp.setParam('background',0.001)
+         
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a BEPolyelectrolyte"""
+        self.assertAlmostEqual(self.comp.run(0.001),0.0948, 3)
+        
+    def test1D_2(self):
+        """ Test 2D model for a BEPolyelectrolyte"""
+        self.assertAlmostEqual(self.comp.run([0.001, 1.3]),0.0948, 3)
+      
+    def testEval_1D(self):
+        """ Test 1D model for a BEPolyelectrolyte with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+        
+    def testEval_2D(self):
+        """ Test 2D model for a BEPolyelectrolyte with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+               
+             
+class TestDABModel(unittest.TestCase):
+    """ Unit tests for DABModel"""
+    
+    def setUp(self):
+        from sans.models.DABModel import DABModel
+        self.comp = DABModel()
+        self.comp.setParam('length',40.0)
+        self.comp.setParam('scale',10.0)
+        self.comp.setParam('background',1.0)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+    
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a DABModel"""
+        self.assertAlmostEqual(self.comp.run(0.001),10.9681, 3)
+        
+    def test1D_2(self):
+        """ Test 2D model for a DABModel"""
+        self.assertAlmostEqual(self.comp.run([0.001, 1.3]),10.9681, 3)
+         
+    def testEval_1D(self):
+        """ Test 1D model for a DABModel with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+        
+    def testEval_2D(self):
+        """ Test 2D model for a DABModel with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+               
+             
+    
+class TestGuinierModel(unittest.TestCase):
+    """ Unit tests for Guinier Model"""
+    
+    def setUp(self):
+        from sans.models.GuinierModel import GuinierModel
+        self.comp = GuinierModel()
+        self.comp.setParam('scale',1.0)
+        self.comp.setParam('rg', 60)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+        
+    def test1D(self):
+        """ Test 1D model for a GuinierModel"""
+        self.assertAlmostEqual(self.comp.run(1.0), 5.6387e-5, 4)
+        
+    def test1D_2(self):
+        """ Test 2D model for a GuinierModel"""
+        self.assertAlmostEqual(self.comp.run([1.0, 1.3]), 5.6387e-5, 4)  
+        from sans.models.GuinierModel import GuinierModel
+        self.shape_indep_list.append(GuinierModel )
+        
+    def testEval_1D(self):
+        """ Test 1D model for a GuinierModel with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a GuinierModel with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+    
+        
+        
+class TestDebyeModel(unittest.TestCase):
+    """ Unit tests for Debye Model"""
+    
+    def setUp(self):
+        from sans.models.DebyeModel import DebyeModel
+        self.comp = DebyeModel()
+        self.comp.setParam('rg', 50.0)
+        self.comp.setParam('scale',1.0)
+        self.comp.setParam('background',0.001)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a DebyeModel"""
+        self.assertAlmostEqual(self.comp.run(0.001),1.00017,4)
+        
+    def test1D_2(self):
+        """ Test 2D model for a DebyeModel"""
+        self.assertAlmostEqual(self.comp.run([0.001, 1.3]),1.00017,4)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a DebyeModel with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a DebyeModel with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+    
+       
+class TestPorodModel(unittest.TestCase):
+    """ Unit tests for PorodModel"""
+    
+    def setUp(self):
+        from sans.models.PorodModel import PorodModel
+        self.comp = PorodModel()
+        self.comp.setParam('scale', 1.0)
+        self.comp.setParam('background', 0.0)
+         
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a PorodModel"""
+        self.assertEquals(self.comp.run(0.5), 16)
+        
+    def test1D_2(self):
+        """ Test 2D model for a PorodModel"""
+        self.assertEquals(self.comp.run([0.5, 1.3]),16)  
+        
+    def testEval_1D(self):
+        """ Test 1D model for a PorodModel with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a PorodModel with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+    
+    def testCreaticalPt(self):
+        """ Test for critical point for PorodModel run"""
+        self.assertRaises(ZeroDivisionError, self.comp.run, 0.0)
+        
+        
+class TestPeakGaussModel(unittest.TestCase):
+    """ Unit tests for PeakGaussModel"""
+    
+    def setUp(self):
+        from sans.models.PeakGaussModel import PeakGaussModel
+        self.comp = PeakGaussModel()
+        self.comp.setParam('scale', 100)
+        self.comp.setParam('B', 0.005)
+        self.comp.setParam('q0',0.05)
+        self.comp.setParam('background',1.0)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a PeakGauss Model"""
+        self.assertEquals(self.comp.run(0.001),1)
+        
+    def test1D_2(self):
+        """ Test 2D model for a PeakGauss Model"""
+        self.assertEquals(self.comp.run([0.001, 1.3]),1)  
+        
+    def testEval_1D(self):
+        """ Test 1D model for a PeakGauss Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a PeakGauss Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+        
+        
+class TestPeakLorentzModel(unittest.TestCase):
+    """ Unit tests for PeakLorentzModel"""
+    
+    def setUp(self):
+        from sans.models.PeakLorentzModel import PeakLorentzModel
+        self.comp = PeakLorentzModel()
+        self.comp.setParam('scale', 100)
+        self.comp.setParam('B', 0.005)
+        self.comp.setParam('q0',0.05)
+        self.comp.setParam('background',1.0)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a PeakLorentz Model"""
+        self.assertAlmostEqual(self.comp.run(0.001), 2.0305, 3)
+        
+    def test1D_2(self):
+        """ Test 2D model for a PeakLorentz Model"""
+        self.assertAlmostEqual(self.comp.run([0.001, 1.3]), 2.0305, 3)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a PeakLorentz Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a PeakLorentz Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+        
+        
+class TestFractalAbsModel(unittest.TestCase):
+    """ Unit tests for FractalAbsModel"""
+    
+    def setUp(self):
+        from sans.models.FractalAbsModel import FractalAbsModel
+        self.comp = FractalAbsModel()
+        self.comp.setParam('scale', 0.05)
+        self.comp.setParam('radius', 5.0)
+        self.comp.setParam('fractal_dim', 2.0)
+        self.comp.setParam('corr_length',100.0)
+        self.comp.setParam('block_sld', 2.0e-6)
+        self.comp.setParam('solvent_sld', 6.35e-6)
+        self.comp.setParam('background',0.0)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a Fractal Abs Model"""
+        self.assertAlmostEqual(self.comp.run(0.001), 39.2881, 3)
+        
+    def test1D_2(self):
+        """ Test 2D model for a Fractal Abs Model"""
+        self.assertAlmostEqual(self.comp.run([0.001, 1.3]), 39.2881, 3)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a Fractal Abs Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a Fractal Abs Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+        
+   
+class TestFractalModel(unittest.TestCase):
+    """ Unit tests for FractalModel"""
+    
+    def setUp(self):
+        from sans.models.FractalModel import FractalModel
+        self.comp = FractalModel()
+        self.comp.setParam('scale', 0.05)
+        self.comp.setParam('radius', 5.0)
+        self.comp.setParam('fractal_dim', 2.0)
+        self.comp.setParam('corr_length',100.0)
+        self.comp.setParam('block_sld', 2.0e-6)
+        self.comp.setParam('solvent_sld', 6.35e-6)
+        self.comp.setParam('background',0.0)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a Fractal Model"""
+        self.assertAlmostEqual(self.comp.run(0.001), 39.2881, 3)
+        
+    def test1D_2(self):
+        """ Test 2D model for a Fractal Model"""
+        self.assertAlmostEqual(self.comp.run([0.001, 1.3]), 39.2881, 3)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a Fractal Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a Fractal Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+        
+    
+class TestLorentzModel(unittest.TestCase):
+    """ Unit tests for LorentzModel"""
+    
+    def setUp(self):
+        from sans.models.LorentzModel import LorentzModel
+        self.comp = LorentzModel()
+        self.comp.setParam("background",1)
+        self.comp.setParam("length",50)
+        self.comp.setParam("scale",100)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a Lorentz Model"""
+        self.assertAlmostEqual(self.comp.run(0.001),100.751, 2)
+        
+    def test1D_2(self):
+        """ Test 2D model for a Lorentz Model"""
+        self.assertAlmostEqual(self.comp.run([0.001, 1.3]),100.751, 2)
+    
+    def testEval_1D(self):
+        """ Test 1D model for a Lorentz Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a Lorentz Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+            
+class TestPowerLawAbsModel(unittest.TestCase):
+    """ Unit tests for PowerLawAbsModel"""
+    
+    def setUp(self):
+        from sans.models.PowerLawAbsModel import PowerLawAbsModel
+        self.comp = PowerLawAbsModel()
+        self.comp.setParam("background",1)
+        self.comp.setParam("m",4)
+        self.comp.setParam("scale",1e-6)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a PowerLawAbs Model"""
+        self.assertAlmostEqual(self.comp.run(0.19189), 1.00074,4)
+        
+    def test1D_2(self):
+        """ Test 2D model for a PowerLawAbs Model"""
+        self.assertAlmostEqual(self.comp.run([0.19189,1.3]), 1.00074,4)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a PowerLawAbs Model with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a PowerLawAbs Model with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+    
+class TestPowerLawModel(unittest.TestCase):
+    """ Unit tests for PowerLawModel"""
+    
+    def setUp(self):
+        from sans.models.PowerLawModel import PowerLawModel
+        self.comp = PowerLawModel()
+        self.comp.setParam("background",1)
+        self.comp.setParam("m",4)
+        self.comp.setParam("scale",1e-6)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a PowerLaw Model"""
+        self.assertAlmostEquals(self.comp.run(0.19189), 1.00074,4)
+        
+    def test1D_2(self):
+        """ Test 2D model for a PowerLawModel"""
+        self.assertAlmostEquals(self.comp.run([0.19189,1.3]), 1.00074,4)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a PowerLawModel with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a PowerLawModel with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+      
+      
+class TestTeubnerStreyModel(unittest.TestCase):
+    """ Unit tests for TeubnerStreyModel"""
+    
+    def setUp(self):
+        from sans.models.TeubnerStreyModel import TeubnerStreyModel
+        self.comp = TeubnerStreyModel()
+        self.comp.setParam("background",0.1)
+        self.comp.setParam("c1",-30)
+        self.comp.setParam("c2",5000)
+        self.comp.setParam("scale",0.1)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a TeubnerStrey Model"""
+        self.assertAlmostEqual(self.comp.run(0.001),10.103, 1)
+        
+    def test1D_2(self):
+        """ Test 2D model for a TeubnerStrey Model"""
+        self.assertAlmostEqual(self.comp.run([0.001, 1.3]),10.103, 1)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a TeubnerStrey  with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a TeubnerStrey  with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+        
+      
+class TestLineModel(unittest.TestCase):
+    """ Unit tests for LineModel"""
+    
+    def setUp(self):
+        from sans.models.LineModel import LineModel
+        self.comp = LineModel()
+        self.comp.setParam("A",1)
+        self.comp.setParam("B",1)
+        
+        self.x = numpy.array([0.4, 1.3])
+        self.y = numpy.array([0.5, 1.57])
+        self.x_array = self.comp.evalDistribution(self.x)
+        self.y_array = self.comp.evalDistribution(self.y)
+        qx_prime = numpy.reshape(self.x, [1,len(self.x)])
+        qy_prime = numpy.reshape(self.y, [len(self.y),1])
+        self.xy_matrix = self.comp.evalDistribution([qx_prime, qy_prime])
+        
+    def test1D(self):
+        """ Test 1D model for a Line Model"""
+        self.assertEquals(self.comp.run(1.0),2)
+        
+    def testEval_1D(self):
+        """ Test 1D model for a Line  with evalDistribution"""
+        self.assertEquals(self.comp.run(0.4),self.x_array[0])
+        self.assertEquals(self.comp.run(1.3),self.x_array[1])
+        
+    def testEval_2D(self):
+        """ Test 2D model for a Line  with evalDistribution"""
+        self.assertAlmostEquals(self.comp.runXY([0.4, 0.5]),self.xy_matrix[0][0],8)
+        self.assertAlmostEquals(self.comp.runXY([0.4,1.57]),self.xy_matrix[1][0], 8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 0.5]),self.xy_matrix[0][1],8)
+        self.assertAlmostEquals(self.comp.runXY([1.3, 1.57]),self.xy_matrix[1][1],8)
+  
+ 
+if __name__ == '__main__':
+    unittest.main()
