Index: sasmodels/models/core_shell_ellipsoid_xt.c
===================================================================
--- sasmodels/models/core_shell_ellipsoid_xt.c	(revision 81bb6683df7d596fa70869ba742026b60f836b22)
+++ sasmodels/models/core_shell_ellipsoid_xt.c	(revision 81bb6683df7d596fa70869ba742026b60f836b22)
@@ -0,0 +1,190 @@
+double form_volume(double equat_core,
+                   double polar_core,
+                   double equat_shell,
+                   double polar_shell);
+double Iq(double q,
+          double equat_core,
+          double x_core,
+          double t_shell,
+          double x_polar_shell,
+          double core_sld,
+          double shell_sld,
+          double solvent_sld);
+
+
+double Iqxy(double qx, double qy,
+          double equat_core,
+          double x_core,
+          double t_shell,
+          double x_polar_shell,
+          double core_sld,
+          double shell_sld,
+          double solvent_sld,
+          double theta,
+          double phi);
+
+
+double form_volume(double equat_core,
+                   double x_core,
+                   double t_shell,
+                   double x_polar_shell)
+{
+	double equat_shell, polar_shell;
+    equat_shell = equat_core + t_shell;
+    polar_shell = equat_core*x_core + t_shell*x_polar_shell;
+    double vol = 4.0*M_PI/3.0*equat_shell*equat_shell*polar_shell;
+    return vol;
+}
+
+static double
+core_shell_ellipsoid_xt_kernel(double q,
+          double equat_core,
+          double x_core,
+          double t_shell,
+          double x_polar_shell,
+          double core_sld,
+          double shell_sld,
+          double solvent_sld)
+{
+	double delpc,delps;
+	double uplim,lolim;		//upper and lower integration limits
+	double summ,zi,yyy,answer; //running tally of integration
+	double polar_core, equat_shell, polar_shell;
+
+	lolim = 0.0;
+	uplim = 1.0;
+
+	summ = 0.0;	 //initialize intergral
+
+	delpc = core_sld - shell_sld; //core - shell
+	delps = shell_sld - solvent_sld; //shell - solvent
+
+
+    polar_core = equat_core*x_core;
+    equat_shell = equat_core + t_shell;
+    polar_shell = equat_core*x_core + t_shell*x_polar_shell;
+
+	for(int i=0;i<76;i++) {
+		zi = ( Gauss76Z[i]*(uplim-lolim) + uplim + lolim )/2.0;
+		yyy = Gauss76Wt[i] * gfn4(zi,
+		                          equat_core,
+                                  polar_core,
+                                  equat_shell,
+                                  polar_shell,
+		                          delpc,
+		                          delps,
+		                          q);
+		summ += yyy;
+	}
+
+	answer = (uplim-lolim)/2.0*summ;
+
+	//convert to [cm-1]
+	answer *= 1.0e-4;
+
+	return answer;
+}
+
+static double
+core_shell_ellipsoid_xt_kernel_2d(double q, double q_x, double q_y,
+          double equat_core,
+          double x_core,
+          double t_shell,
+          double x_polar_shell,
+          double core_sld,
+          double shell_sld,
+          double solvent_sld,
+          double theta,
+          double phi)
+{
+    double cyl_x, cyl_y;
+    double cos_val;
+    double answer;
+    double sldcs,sldss;
+	double polar_core, equat_shell, polar_shell;
+
+    //convert angle degree to radian
+    theta = theta * M_PI/180.0;
+    phi = phi * M_PI/180.0;
+
+
+    // ellipsoid orientation, the axis of the rotation is consistent with the ploar axis.
+    cyl_x = cos(theta) * cos(phi);
+    cyl_y = sin(theta);
+
+    sldcs = core_sld - shell_sld;
+    sldss = shell_sld- solvent_sld;
+
+    // Compute the angle btw vector q and the
+    // axis of the cylinder
+    cos_val = cyl_x*q_x + cyl_y*q_y;
+
+    polar_core = equat_core*x_core;
+    equat_shell = equat_core + t_shell;
+    polar_shell = equat_core*x_core + t_shell*x_polar_shell;
+
+    // Call the IGOR library function to get the kernel:
+    // MUST use gfn4 not gf2 because of the def of params.
+    answer = gfn4(cos_val,
+                  equat_core,
+                  polar_core,
+                  equat_shell,
+                  polar_shell,
+                  sldcs,
+                  sldss,
+                  q);
+
+    //convert to [cm-1]
+    answer *= 1.0e-4;
+
+    return answer;
+}
+
+double Iq(double q,
+          double equat_core,
+          double x_core,
+          double t_shell,
+          double x_polar_shell,
+          double core_sld,
+          double shell_sld,
+          double solvent_sld)
+{
+    double intensity = core_shell_ellipsoid_xt_kernel(q,
+           equat_core,
+           x_core,
+           t_shell,
+           x_polar_shell,
+           core_sld,
+           shell_sld,
+           solvent_sld);
+
+    return intensity;
+}
+
+
+double Iqxy(double qx, double qy,
+          double equat_core,
+          double x_core,
+          double t_shell,
+          double x_polar_shell,
+          double core_sld,
+          double shell_sld,
+          double solvent_sld,
+          double theta,
+          double phi)
+{
+    double q;
+    q = sqrt(qx*qx+qy*qy);
+    double intensity = core_shell_ellipsoid_xt_kernel_2d(q, qx/q, qy/q,
+                       equat_core,
+                       x_core,
+                       t_shell,
+                       x_polar_shell,
+                       core_sld,
+                       shell_sld,
+                       solvent_sld,
+                       theta,
+                       phi);
+
+    return intensity;
+}
Index: sasmodels/models/core_shell_ellipsoid_xt.py
===================================================================
--- sasmodels/models/core_shell_ellipsoid_xt.py	(revision 81bb6683df7d596fa70869ba742026b60f836b22)
+++ sasmodels/models/core_shell_ellipsoid_xt.py	(revision 81bb6683df7d596fa70869ba742026b60f836b22)
@@ -0,0 +1,171 @@
+r"""
+An alternative version of $P(q)$ for the core-shell ellipsoid
+(see CoreShellEllipsoidModel), having as parameters the core axial ratio X
+and a shell thickness, which are more often what we would like to determine.
+
+This model is also better behaved when polydispersity is applied than the four
+independent radii in CoreShellEllipsoidModel.
+
+Definition
+----------
+
+.. figure:: img/core_shell_ellipsoid_fig1.gif
+
+
+The geometric parameters of this model are
+
+*equat_core =* equatorial core radius *= R_minor_core*
+
+*X_core = polar_core / equat_core = Rmajor_core / Rminor_core*
+
+*T_shell = equat_outer - equat_core = Rminor_outer - Rminor_core*
+
+*XpolarShell = Tpolar_shell / T_shell = (Rmajor_outer - Rmajor_core)/
+(Rminor_outer - Rminor_core)*
+
+In terms of the original radii
+
+*polar_core = equat_core * X_core*
+
+*equat_shell = equat_core + T_shell*
+
+*polar_shell = equat_core * X_core + T_shell * XpolarShell*
+
+(where we note that "shell" perhaps confusingly, relates to the outer radius)
+When *X_core < 1* the core is oblate; when *X_core > 1* it is prolate.
+*X_core = 1* is a spherical core.
+
+For a fixed shell thickness *XpolarShell = 1*, to scale the shell thickness
+pro-rata with the radius *XpolarShell = X_core*.
+
+When including an $S(q)$, the radius in $S(q)$ is calculated to be that of
+a sphere with the same 2nd virial coefficient of the outer surface of the
+ellipsoid. This may have some undesirable effects if the aspect ratio of the
+ellipsoid is large (ie, if $X << 1$ or $X >> 1$ ), when the $S(q)$
+- which assumes spheres - will not in any case be valid.
+
+If SAS data are in absolute units, and the SLDs are correct, then scale should
+be the total volume fraction of the "outer particle". When $S(q)$ is introduced
+this moves to the $S(q)$ volume fraction, and scale should then be 1.0,
+or contain some other units conversion factor (for example, if you have SAXS data).
+
+References
+----------
+
+R K Heenan, *Private communication*
+
+"""
+
+from numpy import inf, sin, cos, pi
+
+name = "core_shell_ellipsoid_xt"
+title = "Form factor for an spheroid ellipsoid particle with a core shell structure."
+description = """
+        [core_shell_ellipsoid_xt] Calculates the form factor for an spheroid
+        ellipsoid particle with a core_shell structure.
+        The form factor is averaged over all possible
+        orientations of the ellipsoid such that P(q)
+        = scale*<f^2>/Vol + bkg, where f is the
+        single particle scattering amplitude.
+        [Parameters]:
+        equat_core = equatorial radius of core,
+        x_core = polar radius of core,
+        t_shell = equatorial radius of outer surface,
+        x_polar_shell = polar radius (revolution axis) of outer surface
+        core_sld = SLD_core
+        shell_sld = SLD_shell
+        solvent_sld = SLD_solvent
+        background = Incoherent bkg
+        scale =scale
+        Note:It is the users' responsibility to ensure
+        that shell radii are larger than core radii.
+        oblate: polar radius < equatorial radius
+        prolate :  polar radius > equatorial radius - this new model will make this easier
+        and polydispersity integrals more logical (as previously the shell could disappear).
+    """
+category = "shape:ellipsoid"
+
+# pylint: disable=bad-whitespace, line-too-long
+#             ["name", "units", default, [lower, upper], "type", "description"],
+parameters = [
+    ["equat_core",    "Ang",       20,   [0, inf],    "volume",      "Equatorial radius of core"],
+    ["x_core",        "None",       3,   [0, inf],    "volume",      "Polar radius of core"],
+    ["t_shell",       "Ang",       30,   [0, inf],    "volume",      "Equatorial radius of shell"],
+    ["x_polar_shell", "",           1,   [0, inf],    "volume",      "Polar radius of shell"],
+    ["core_sld",      "1e-6/Ang^2", 2,   [-inf, inf], "",            "Core scattering length density"],
+    ["shell_sld",     "1e-6/Ang^2", 1,   [-inf, inf], "",            "Shell scattering length density"],
+    ["solvent_sld",   "1e-6/Ang^2", 6.3, [-inf, inf], "",            "Solvent scattering length density"],
+    ["theta",         "degrees",    0,   [-inf, inf], "orientation", "Oblate orientation wrt incoming beam"],
+    ["phi",           "degrees",    0,   [-inf, inf], "orientation", "Oblate orientation in the plane of the detector"],
+    ]
+# pylint: enable=bad-whitespace, line-too-long
+
+source = ["lib/gfn.c", "lib/gauss76.c", "core_shell_ellipsoid_xt.c"]
+
+demo = dict(scale=0.05, background=0.001,
+            equat_core=20.0,
+            x_core=3.0,
+            t_shell=30.0,
+            x_polar_shell=1.0,
+            core_sld=2.0,
+            shell_sld=1.0,
+            solvent_sld=6.3,
+            theta=0,
+            phi=0)
+
+oldname = 'CoreShellEllipsoidXTModel'
+
+oldpars = dict(x_polar_shell='XpolarShell',
+               x_core='X_core',
+               t_shell='T_shell',
+               core_sld='sld_core',
+               shell_sld='sld_shell',
+               solvent_sld='sld_solvent',
+               theta='axis_theta',
+               phi='axis_phi')
+
+q = 0.1
+phi = pi/6
+qx = q*cos(phi)
+qy = q*sin(phi)
+
+tests = [
+    # Accuracy tests based on content in test/utest_coreshellellipsoidXTmodel.py
+    [{'equat_core': 200.0,
+      'x_core': 0.1,
+      't_shell': 50.0,
+      'x_polar_shell': 0.2,
+      'core_sld': 2.0,
+      'shell_sld': 1.0,
+      'solvent_sld': 6.3,
+      'background': 0.001,
+      'scale': 1.0,
+     }, 1.0, 0.00189402],
+
+    # Additional tests with larger range of parameters
+    [{'background': 0.01}, 0.1, 11.6915],
+
+    [{'equat_core': 20.0,
+      'x_core': 200.0,
+      't_shell': 54.0,
+      'x_polar_shell': 3.0,
+      'core_sld': 20.0,
+      'shell_sld': 10.0,
+      'solvent_sld': 6.0,
+      'background': 0.0,
+      'scale': 1.0,
+     }, 0.01, 8688.53],
+
+    [{'background': 0.001}, (0.4, 0.5), 0.00690673],
+
+    [{'equat_core': 20.0,
+      'x_core': 200.0,
+      't_shell': 54.0,
+      'x_polar_shell': 3.0,
+      'core_sld': 20.0,
+      'shell_sld': 10.0,
+      'solvent_sld': 6.0,
+      'background': 0.01,
+      'scale': 0.01,
+     }, (qx, qy), 0.0100002],
+    ]
