Index: src/sas/sascalc/simulation/iqPy/iqPymodule/Make.mm
===================================================================
--- src/sas/sascalc/simulation/iqPy/iqPymodule/Make.mm	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sascalc/simulation/iqPy/iqPymodule/Make.mm	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
@@ -0,0 +1,31 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+PROJECT = SASsimulation
+PACKAGE = iqPymodule
+MODULE = iqPy
+
+include std-pythonmodule.def
+include local.def
+
+PROJ_CXX_SRCLIB = -liqPy 
+PROJ_SRCS = \
+    bindings.cc \
+    exceptions.cc \
+    misc.cc
+
+
+# version
+# $Id$
+
+# End of file
Index: src/sas/sascalc/simulation/iqPy/iqPymodule/bindings.cc
===================================================================
--- src/sas/sascalc/simulation/iqPy/iqPymodule/bindings.cc	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sascalc/simulation/iqPy/iqPymodule/bindings.cc	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
@@ -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 pyiqPy_methods[] = {
+
+    // new_iq
+    {pyiqPy_new_iq__name__, pyiqPy_new_iq,
+     METH_VARARGS, "iq(int numI,double qmin, double qmax)->new IQ object"},
+
+    //OutputIQ
+    {pyiqPy_OutputIQ__name__, pyiqPy_OutputIQ,
+     METH_VARARGS, pyiqPy_OutputIQ__doc__},
+
+    {pyiqPy_copyright__name__, pyiqPy_copyright,
+     METH_VARARGS, pyiqPy_copyright__doc__},
+
+
+// Sentinel
+    {0, 0}
+};
+
+// version
+// $Id$
+
+// End of file
Index: src/sas/sascalc/simulation/iqPy/iqPymodule/bindings.h
===================================================================
--- src/sas/sascalc/simulation/iqPy/iqPymodule/bindings.h	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sascalc/simulation/iqPy/iqPymodule/bindings.h	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+#if !defined(pyiqPy_bindings_h)
+#define pyiqPy_bindings_h
+
+// the method table
+
+extern struct PyMethodDef pyiqPy_methods[];
+
+#endif
+
+// version
+// $Id$
+
+// End of file
Index: src/sas/sascalc/simulation/iqPy/iqPymodule/exceptions.cc
===================================================================
--- src/sas/sascalc/simulation/iqPy/iqPymodule/exceptions.cc	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sascalc/simulation/iqPy/iqPymodule/exceptions.cc	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
@@ -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 *pyiqPy_runtimeError = 0;
+    
+// version
+// $Id$
+
+// End of file
Index: src/sas/sascalc/simulation/iqPy/iqPymodule/exceptions.h
===================================================================
--- src/sas/sascalc/simulation/iqPy/iqPymodule/exceptions.h	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sascalc/simulation/iqPy/iqPymodule/exceptions.h	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+#if !defined(pyiqPy_exceptions_h)
+#define pyiqPy_exceptions_h
+
+// exceptions
+
+extern PyObject *pyiqPy_runtimeError;
+
+#endif
+
+// version
+// $Id$
+
+// End of file
Index: src/sas/sascalc/simulation/iqPy/iqPymodule/iqPymodule.cc
===================================================================
--- src/sas/sascalc/simulation/iqPy/iqPymodule/iqPymodule.cc	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sascalc/simulation/iqPy/iqPymodule/iqPymodule.cc	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
@@ -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 pyiqPy_module__doc__[] = "";
+
+// Initialization function for the module (*must* be called initiqPy)
+extern "C"
+void
+initiqPy()
+{
+    // create the module and add the functions
+    PyObject * m = Py_InitModule4(
+        "iqPy", pyiqPy_methods,
+        pyiqPy_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 iqPy");
+    }
+
+    // install the module exceptions
+    pyiqPy_runtimeError = PyErr_NewException("iqPy.runtime", 0, 0);
+    PyDict_SetItemString(d, "RuntimeException", pyiqPy_runtimeError);
+
+    return;
+}
+
+// version
+// $Id$
+
+// End of file
Index: src/sas/sascalc/simulation/iqPy/iqPymodule/local.def
===================================================================
--- src/sas/sascalc/simulation/iqPy/iqPymodule/local.def	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sascalc/simulation/iqPy/iqPymodule/local.def	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
@@ -0,0 +1,21 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+# C++
+
+    PROJ_CXX_INCLUDES = ../libiqPy/tnt \
+			../libiqPy
+# version
+# $Id$
+
+# End of file
Index: src/sas/sascalc/simulation/iqPy/iqPymodule/misc.cc
===================================================================
--- src/sas/sascalc/simulation/iqPy/iqPymodule/misc.cc	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sascalc/simulation/iqPy/iqPymodule/misc.cc	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
@@ -0,0 +1,82 @@
+// -*- 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 "iq.h"
+
+
+// copyright
+
+char pyiqPy_copyright__doc__[] = "";
+char pyiqPy_copyright__name__[] = "copyright";
+
+static char pyiqPy_copyright_note[] = 
+    "iqPy python module: Copyright (c) 1998-2005 Michael A.G. Aivazis";
+
+
+PyObject * pyiqPy_copyright(PyObject *, PyObject *)
+{
+    return Py_BuildValue("s", pyiqPy_copyright_note);
+}
+    
+// iq(int numI,double qmin,double qmax)
+char pyiqPy_new_iq__doc__[] = "wrap class iq in C++";
+char pyiqPy_new_iq__name__[] = "new_iq";
+
+PyObject * pyiqPy_new_iq(PyObject *, PyObject *args)
+{
+  int py_numI;
+  double py_qmin, py_qmax;
+  int ok = PyArg_ParseTuple(args,"idd",&py_numI, &py_qmin, &py_qmax);
+  if(!ok) return 0;
+
+  IQ *iq = new IQ(py_numI,py_qmin,py_qmax);
+  
+  return PyCObject_FromVoidPtr(iq, NULL);
+}
+
+//output iq to file
+extern char pyiqPy_OutputIQ__name__[] = "OutputIQ";
+extern char pyiqPy_OutputIQ__doc__[] = "";
+
+PyObject * pyiqPy_OutputIQ(PyObject *, PyObject *args){
+  PyObject *pyiq = 0;
+  char *outfile;
+  int ok = PyArg_ParseTuple(args,"Os", &pyiq, &outfile);
+  if(!ok) return NULL;
+
+  void *temp = PyCObject_AsVoidPtr(pyiq);
+
+  IQ * thisiq = static_cast<IQ *>(temp);
+
+  thisiq->OutputIQ(outfile);
+
+  return Py_BuildValue("i",0);
+}
+
+//release the iq object
+static void PyDeliq(void *ptr)
+{
+  std::cout<<"Called PyDeliq()\n"; //Good to see once
+  IQ * oldiq = static_cast<IQ *>(ptr);
+  delete oldiq;
+  return;
+}
+    
+// version
+// $Id$
+
+// End of file
Index: src/sas/sascalc/simulation/iqPy/iqPymodule/misc.h
===================================================================
--- src/sas/sascalc/simulation/iqPy/iqPymodule/misc.h	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sascalc/simulation/iqPy/iqPymodule/misc.h	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+#if !defined(pyiqPy_misc_h)
+#define pyiqPy_misc_h
+
+// copyright
+extern char pyiqPy_copyright__name__[];
+extern char pyiqPy_copyright__doc__[];
+extern "C"
+PyObject * pyiqPy_copyright(PyObject *, PyObject *);
+
+// iq constructor, iq(int, double, double)
+extern char pyiqPy_new_iq__name__[];
+extern char pyiqPy_new_iq__doc__[];
+extern "C"
+PyObject * pyiqPy_new_iq(PyObject *, PyObject *);
+
+//output iq to file
+extern char pyiqPy_OutputIQ__name__[];
+extern char pyiqPy_OutputIQ__doc__[];
+extern "C"
+PyObject * pyiqPy_OutputIQ(PyObject *, PyObject *);
+
+//release the iq object
+static void PyDeliq(void *ptr);
+
+#endif
+
+// version
+// $Id$
+
+// End of file
