Index: src/sans/simulation/analmodelpy/analmodelpymodule/Make.mm
===================================================================
--- src/sans/simulation/analmodelpy/analmodelpymodule/Make.mm	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
+++ src/sans/simulation/analmodelpy/analmodelpymodule/Make.mm	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
@@ -0,0 +1,32 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+PROJECT = SANSsimulation
+PACKAGE = analmodelpymodule
+MODULE = analmodelpy
+
+include std-pythonmodule.def
+include local.def
+
+PROJ_CXX_SRCLIB = -lanalmodelpy
+
+PROJ_SRCS = \
+    bindings.cc \
+    exceptions.cc \
+    misc.cc
+
+
+# version
+# $Id$
+
+# End of file
Index: src/sans/simulation/analmodelpy/analmodelpymodule/analmodelpymodule.cc
===================================================================
--- src/sans/simulation/analmodelpy/analmodelpymodule/analmodelpymodule.cc	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
+++ src/sans/simulation/analmodelpy/analmodelpymodule/analmodelpymodule.cc	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+//#include <portinfo>
+
+#include <Python.h>
+
+#include "exceptions.h"
+#include "bindings.h"
+
+
+char pyanalmodelpy_module__doc__[] = "";
+
+// Initialization function for the module (*must* be called initanalmodelpy)
+extern "C"
+void
+initanalmodelpy()
+{
+    // create the module and add the functions
+    PyObject * m = Py_InitModule4(
+        "analmodelpy", pyanalmodelpy_methods,
+        pyanalmodelpy_module__doc__, 0, PYTHON_API_VERSION);
+
+    // get its dictionary
+    PyObject * d = PyModule_GetDict(m);
+
+    // check for errors
+    if (PyErr_Occurred()) {
+        Py_FatalError("can't initialize module analmodelpy");
+    }
+
+    // install the module exceptions
+    pyanalmodelpy_runtimeError = PyErr_NewException("analmodelpy.runtime", 0, 0);
+    PyDict_SetItemString(d, "RuntimeException", pyanalmodelpy_runtimeError);
+
+    return;
+}
+
+// version
+// $Id$
+
+// End of file
Index: src/sans/simulation/analmodelpy/analmodelpymodule/bindings.cc
===================================================================
--- src/sans/simulation/analmodelpy/analmodelpymodule/bindings.cc	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
+++ src/sans/simulation/analmodelpy/analmodelpymodule/bindings.cc	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
@@ -0,0 +1,44 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+//#include <portinfo>
+#include <Python.h>
+
+#include "bindings.h"
+
+#include "misc.h"          // miscellaneous methods
+
+// the method table
+
+struct PyMethodDef pyanalmodelpy_methods[] = {
+
+    // new analmodel
+    {pyanalmodelpy_new_analmodel__name__, pyanalmodelpy_new_analmodel,
+     METH_VARARGS, pyanalmodelpy_new_analmodel__doc__},
+
+    //analmodel method: CalculateIQ
+    {pyanalmodelpy_CalculateIQ__name__, pyanalmodelpy_CalculateIQ,
+     METH_VARARGS, pyanalmodelpy_CalculateIQ__doc__},
+
+    {pyanalmodelpy_copyright__name__, pyanalmodelpy_copyright,
+     METH_VARARGS, pyanalmodelpy_copyright__doc__},
+
+
+// Sentinel
+    {0, 0}
+};
+
+// version
+// $Id$
+
+// End of file
Index: src/sans/simulation/analmodelpy/analmodelpymodule/bindings.h
===================================================================
--- src/sans/simulation/analmodelpy/analmodelpymodule/bindings.h	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
+++ src/sans/simulation/analmodelpy/analmodelpymodule/bindings.h	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+#if !defined(pyanalmodelpy_bindings_h)
+#define pyanalmodelpy_bindings_h
+
+// the method table
+
+extern struct PyMethodDef pyanalmodelpy_methods[];
+
+#endif
+
+// version
+// $Id$
+
+// End of file
Index: src/sans/simulation/analmodelpy/analmodelpymodule/exceptions.cc
===================================================================
--- src/sans/simulation/analmodelpy/analmodelpymodule/exceptions.cc	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
+++ src/sans/simulation/analmodelpy/analmodelpymodule/exceptions.cc	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
@@ -0,0 +1,22 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+//#include <portinfo>
+#include <Python.h>
+
+PyObject *pyanalmodelpy_runtimeError = 0;
+    
+// version
+// $Id$
+
+// End of file
Index: src/sans/simulation/analmodelpy/analmodelpymodule/exceptions.h
===================================================================
--- src/sans/simulation/analmodelpy/analmodelpymodule/exceptions.h	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
+++ src/sans/simulation/analmodelpy/analmodelpymodule/exceptions.h	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+#if !defined(pyanalmodelpy_exceptions_h)
+#define pyanalmodelpy_exceptions_h
+
+// exceptions
+
+extern PyObject *pyanalmodelpy_runtimeError;
+
+#endif
+
+// version
+// $Id$
+
+// End of file
Index: src/sans/simulation/analmodelpy/analmodelpymodule/local.def
===================================================================
--- src/sans/simulation/analmodelpy/analmodelpymodule/local.def	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
+++ src/sans/simulation/analmodelpy/analmodelpymodule/local.def	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
@@ -0,0 +1,25 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+# C++
+
+    PROJ_CXX_INCLUDES = ../libanalmodelpy   \
+			../../iqPy/libiqPy  \
+			../../iqPy/libiqPy/tnt  \
+			../../geoshapespy/libgeoshapespy  \
+			../../pointsmodelpy/libpointsmodelpy
+
+# version
+# $Id$
+
+# End of file
Index: src/sans/simulation/analmodelpy/analmodelpymodule/misc.cc
===================================================================
--- src/sans/simulation/analmodelpy/analmodelpymodule/misc.cc	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
+++ src/sans/simulation/analmodelpy/analmodelpymodule/misc.cc	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+//#include <portinfo>
+#include <Python.h>
+
+#include "misc.h"
+#include "analytical_model.h"
+#include "geo_shape.h"
+#include "iq.h"
+
+// copyright
+
+char pyanalmodelpy_copyright__doc__[] = "";
+char pyanalmodelpy_copyright__name__[] = "copyright";
+
+static char pyanalmodelpy_copyright_note[] = 
+    "analmodelpy python module: Copyright (c) 1998-2005 Michael A.G. Aivazis";
+
+
+PyObject * pyanalmodelpy_copyright(PyObject *, PyObject *)
+{
+    return Py_BuildValue("s", pyanalmodelpy_copyright_note);
+}
+
+//extern char pyanalmodelpy_GetRadius__name__[] = "";
+//extern char pyanalmodelpy_GetRadius__doc__[] = "GetRadius";
+//PyObject * pyanalmodelpy_GetRadius(PyObject *, PyObject *args){
+//  double r = Sphere::GetRadius();
+//  
+//  return PyBuildValue("d", r);
+//}
+
+
+    
+// analytical_model class constructor  AnalyticalModel(Sphere &)
+
+char pyanalmodelpy_new_analmodel__doc__[] = "";
+char pyanalmodelpy_new_analmodel__name__[] = "new_analmodel";
+
+PyObject * pyanalmodelpy_new_analmodel(PyObject *, PyObject *args)
+{
+  PyObject *pyshape = 0;
+  int ok = PyArg_ParseTuple(args, "O", &pyshape);
+  if(!ok) return NULL;
+
+  void *temp = PyCObject_AsVoidPtr(pyshape);
+
+  GeoShape *shape = static_cast<GeoShape *>(temp);
+
+  AnalyticalModel *newanal = new AnalyticalModel(*shape);
+
+  return PyCObject_FromVoidPtr(newanal, NULL);
+}
+
+//AnalyticalModel method: CalculateIQ(IQ *)
+char pyanalmodelpy_CalculateIQ__doc__[] = "";
+char pyanalmodelpy_CalculateIQ__name__[] = "CalculateIQ";
+
+PyObject * pyanalmodelpy_CalculateIQ(PyObject *, PyObject *args)
+{
+  PyObject *pyanal = 0, *pyiq = 0;
+  int ok = PyArg_ParseTuple(args, "OO", &pyanal, &pyiq);
+  if(!ok) return NULL;
+                                                                 
+  void *temp = PyCObject_AsVoidPtr(pyanal);
+  void *temp2 = PyCObject_AsVoidPtr(pyiq);
+                                         
+  AnalyticalModel * thisanal = static_cast<AnalyticalModel *>(temp);
+  IQ * thisiq = static_cast<IQ *>(temp2);
+
+  thisanal->CalculateIQ(thisiq);
+                        
+  return Py_BuildValue("i",0);
+
+}
+    
+// version
+// $Id$
+
+// End of file
Index: src/sans/simulation/analmodelpy/analmodelpymodule/misc.h
===================================================================
--- src/sans/simulation/analmodelpy/analmodelpymodule/misc.h	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
+++ src/sans/simulation/analmodelpy/analmodelpymodule/misc.h	(revision aa639ea269b76d78cd120b41705f70280ef4e03e)
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+#if !defined(pyanalmodelpy_misc_h)
+#define pyanalmodelpy_misc_h
+
+// copyright
+extern char pyanalmodelpy_copyright__name__[];
+extern char pyanalmodelpy_copyright__doc__[];
+extern "C"
+PyObject * pyanalmodelpy_copyright(PyObject *, PyObject *);
+
+extern char pyanalmodelpy_GetRadius__name__[];
+extern char pyanalmodelpy_GetRadius__doc__[];
+extern "C"
+PyObject * pyanalmodelpy_GetRadius(PyObject *, PyObject *);
+
+
+// Analytical Model constructor
+extern char pyanalmodelpy_new_analmodel__name__[];
+extern char pyanalmodelpy_new_analmodel__doc__[];
+extern "C"
+PyObject * pyanalmodelpy_new_analmodel(PyObject *, PyObject *);
+
+// AnalyticalModel method: CalculateIQ(IQ *)
+extern char pyanalmodelpy_CalculateIQ__name__[];
+extern char pyanalmodelpy_CalculateIQ__doc__[];
+extern "C"
+PyObject * pyanalmodelpy_CalculateIQ(PyObject *, PyObject *);
+
+
+#endif
+
+// version
+// $Id$
+
+// End of file
