Index: calculatorview/src/sans/perspectives/calculator/gen_scatter_panel.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/gen_scatter_panel.py	(revision 644f95b6956bc8eed8d051385e4bda682718399d)
+++ calculatorview/src/sans/perspectives/calculator/gen_scatter_panel.py	(revision 9624cda0fe91bcf5da3751e7d23fa3047d7ffcb3)
@@ -21,5 +21,6 @@
 from data_util.calcthread import CalcThread
 from sans.guiframe.local_perspectives.plotting.SimplePlot import PlotFrame
-from sans.guiframe.dataFitting import Data2D
+from sans.guiframe.dataFitting import Data2D 
+from sans.guiframe.dataFitting import Data1D
 from sans.dataloader.data_info import Detector
 from sans.dataloader.data_info import Source
@@ -46,4 +47,5 @@
 _QMAX_DEFAULT = 0.3
 _NPTS_DEFAULT = 50 
+_Q1D_MIN = 0.001
 
 def add_icon(parent, frame):
@@ -84,6 +86,6 @@
                  completefn = None,
                  updatefn   = None,
-                 elapsed = 0,
-                 yieldtime  = 0.005,
+                 #elapsed = 0,
+                 yieldtime  = 0.01,
                  worktime   = 0.01):
         """
@@ -96,4 +98,5 @@
         self.id = id 
         self.input = input 
+        self.update_fn = updatefn
         
     def compute(self):
@@ -101,8 +104,7 @@
         excuting computation
         """
-        elapsed = time.time() - self.starttime
-       
-        self.complete(input=self.input,
-                      elapsed = elapsed)
+        #elapsed = time.time() - self.starttime
+        self.starttime = time.time()
+        self.complete(input=self.input, update=self.update_fn)
             
 class SasGenPanel(ScrolledPanel, PanelBase):
@@ -140,4 +142,5 @@
         self.data = None
         self.scale2d = None
+        self.is_avg = False
         self.plot_frame = None
         self.qmax_x = _QMAX_DEFAULT
@@ -299,5 +302,6 @@
                                       style=wx.CB_READONLY) 
         orient_combo.Append('Fixed orientation')
-        orient_combo.Append('No orientation ')
+        orient_combo.Append('Debye full avg.')
+        #orient_combo.Append('Debye sph. sym.')
         
         orient_combo.Bind(wx.EVT_COMBOBOX, self._on_orient_select)
@@ -311,6 +315,11 @@
         event.Skip()
         cb = event.GetEventObject()
-        is_avg = cb.GetCurrentSelection() == 1
-        self.model.set_is_avg(is_avg)         
+        if cb.GetCurrentSelection() == 2:
+            self.is_avg = None
+        else:
+            is_avg = cb.GetCurrentSelection() == 1
+            self.is_avg = is_avg
+        self.model.set_is_avg(self.is_avg)
+        self.set_est_time()    
            
     def _layout_qrange(self):
@@ -360,6 +369,6 @@
             Do the layout for the button widgets
         """ 
-        self.est_time = '*Estimated Computation time : %s sec'
-        self.time_text = wx.StaticText(self, -1, self.est_time% str(2) )
+        self.est_time = '*Estimated Computation time : %s'
+        self.time_text = wx.StaticText(self, -1, self.est_time% str('2 sec') )
         self.orient_combo = self._fill_orient_combo()
         self.orient_combo.Show(False)
@@ -368,5 +377,5 @@
         self.bt_compute.SetToolTipString("Compute 2D Scattering Pattern.")
         self.button_sizer.AddMany([(self.time_text , 0, wx.LEFT, 20),
-                                   (self.orient_combo , 0, wx.LEFT, 20),
+                                   (self.orient_combo , 0, wx.LEFT, 40),
                                    (self.bt_compute, 0, wx.LEFT, 20)])
         
@@ -378,4 +387,6 @@
         n_qbins *= n_qbins
         n_pixs = float(self.parent.get_npix())
+        if self.is_avg:
+            n_pixs *= (n_pixs / 200)
         x_in = n_qbins * n_pixs / 100000
         # magic equation: not very accurate
@@ -387,7 +398,14 @@
         Set text for est. computation time
         """
+        unit = 'sec'
         if self.time_text != None:
+            self.time_text.SetForegroundColour('black')
             etime = self.estimate_ctime()
-            self.time_text.SetLabel(self.est_time% str(etime))
+            if etime > 60:
+                etime /= 60
+                unit = 'min'
+                self.time_text.SetForegroundColour('red')
+            time_str = str(etime) + ' ' + unit
+            self.time_text.SetLabel(self.est_time% time_str)
         
     def _do_layout(self):
@@ -541,4 +559,5 @@
             self.file_name = filename.split('.')[0]
             self.orient_combo.SetSelection(0)
+            self.is_avg = False
             if self.ext in self.omfreader.ext:
                 gen = sans_gen.OMF2SLD()
@@ -577,6 +596,6 @@
         Set sld data helper
         """
-        is_avg = self.orient_combo.GetCurrentSelection() == 1
-        self.model.set_is_avg(is_avg)
+        #is_avg = self.orient_combo.GetCurrentSelection() == 1
+        self.model.set_is_avg(self.is_avg)
         self.model.set_sld_data(self.sld_data)
         
@@ -741,5 +760,5 @@
             graph_title += " - Magnetic Vector as Arrow -" 
             panel = self.plot_frame.plotpanel
-            def _draw_arrow(input=None, elapsed=0.1):
+            def _draw_arrow(input=None, update=None):
                 """
                 draw magnetic vectors w/arrow
@@ -828,15 +847,20 @@
             self.model.set_sld_data(self.sld_data)
             self.set_input_params()
-            self._create_default_2d_data()
-            i_out = numpy.zeros(len(self.data.data))
+            if self.is_avg or self.is_avg == None:
+                self._create_default_1d_data()
+                i_out = numpy.zeros(len(self.data.y))
+                inputs = [self.data.x, [], i_out]
+            else:
+                self._create_default_2d_data()
+                i_out = numpy.zeros(len(self.data.data))
+                inputs=[self.data.qx_data, self.data.qy_data, i_out]
+                
             msg = "Computation is in progress..."
             status_type = 'progress'
             self._status_info(msg, status_type)
-            
-            cal_out = CalcGen(input=[self.data.qx_data, 
-                                     self.data.qy_data, i_out], 
+            cal_out = CalcGen(input=inputs, 
                               completefn=self.complete, 
                               updatefn=self._update)
-            cal_out.queue()
+            cal_out.queue()              
             
         except:
@@ -900,22 +924,47 @@
     def _update(self, time=None):
         """
-        Update the output of plotting model
-        """
-        if self.parent.parent != None:
-            msg = "Computation/drawing is in progress..."
-            wx.PostEvent(self.parent.parent, 
-                         StatusEvent(status=msg, type="update"))
+        Update the progress bar
+        """
+        if self.parent.parent == None:
+            return
+        type = "progress"
+        msg = "Please wait. Computing... (Note: Window may look frozen.)"
+        wx.PostEvent(self.parent.parent, StatusEvent(status=msg,
+                                                  type=type))
                                 
-    def complete(self, input, elapsed=None):   
+    def complete(self, input, update=None):   
         """
         Gen compute complete function
         :Param input: input list [qx_data, qy_data, i_out]
         """
-        out = self.model.runXY(input)
-        self._draw2D(out)
+        out = numpy.empty(0)
+        #s = time.time()
+        for ind in range(len(input[0])):
+            if self.is_avg:
+                if ind % 1 == 0 and update != None:
+                    update()
+                    time.sleep(0.1)
+                inputi = [input[0][ind:ind+1], [], input[2][ind:ind+1]]
+                outi = self.model.run(inputi)
+                out = numpy.append(out, outi)
+            else:
+                if ind % 50 == 0  and update != None:
+                    update()
+                    time.sleep(0.001)
+                inputi = [input[0][ind:ind+1], input[1][ind:ind+1], 
+                          input[2][ind:ind+1]]
+                outi = self.model.runXY(inputi)
+                out = numpy.append(out, outi)
+        #print time.time() - s
+        if self.is_avg or self.is_avg == None:
+            self._draw1D(out)
+        else:
+            #out = self.model.runXY(input)
+            self._draw2D(out)
+            
         msg = "Gen computation completed.\n"
         status_type = 'stop'
         self._status_info(msg, status_type)
-        
+               
     def _create_default_2d_data(self):
         """
@@ -977,5 +1026,86 @@
         self.data.ymin = ymin
         self.data.ymax = ymax
-        
+
+    def _create_default_1d_data(self):
+        """
+        Create 2D data by default
+        Only when the page is on theory mode.
+        :warning: This data is never plotted.
+                    residuals.x = data_copy.x[index]
+            residuals.dy = numpy.ones(len(residuals.y))
+            residuals.dx = None
+            residuals.dxl = None
+            residuals.dxw = None
+        """
+        self.qmax_x = float(self.qmax_ctl.GetValue())
+        self.npts_x = int(float(self.npt_ctl.GetValue()))
+        qmax = self.qmax_x #/ numpy.sqrt(2)
+        ## Default values
+        xmax = qmax
+        xmin = qmax * _Q1D_MIN
+        qstep = self.npts_x
+        x = numpy.linspace(start=xmin, stop=xmax, num=qstep, endpoint=True)
+        # store x and y bin centers in q space
+        #self.data.source = Source()
+        y = numpy.ones(len(x))
+        dy = numpy.zeros(len(x))
+        dx = numpy.zeros(len(x))
+        self.data = Data1D(x=x, y=y)
+        self.data.dx = dx
+        self.data.dy = dy
+
+    def _draw1D(self, y_out):
+        """
+        Complete get the result of modelthread and create model 2D
+        that can be plot.
+        """
+        page_id = self.id
+        data = self.data
+        
+        model = self.model
+        state = None
+        
+        new_plot = Data1D(x=data.x, y=y_out)
+        new_plot.dx = data.dx
+        new_plot.dy = data.dy
+        new_plot.xaxis('\\rm{Q_{x}}', '\AA^{-1}')
+        new_plot.yaxis('\\rm{Intensity}', 'cm^{-1}')
+        new_plot.is_data = False
+        new_plot.id = str(self.uid) + " GenData1D"
+        new_plot.group_id = str(self.uid) + " Model1D"
+        new_plot.name = model.name + '1d'
+        new_plot.title = "Generic model1D "
+        new_plot.id = str(page_id) + ': ' + self.file_name \
+                        + ' #%s'% str(self.graph_num) + "_1D"
+        new_plot.group_id = str(page_id) + " Model1D"  +\
+                             ' #%s'% str(self.graph_num) + "_1D"
+        new_plot.is_data = False
+
+        title = new_plot.title
+        _yaxis, _yunit = new_plot.get_yaxis()
+        _xaxis, _xunit = new_plot.get_xaxis()
+        new_plot.xaxis(str(_xaxis), str(_xunit))
+        new_plot.yaxis(str(_yaxis), str(_yunit))
+        
+        if new_plot.is_data:
+            data_name = str(new_plot.name)
+        else:
+            data_name = str(model.__class__.__name__) + '1d'
+
+        if len(title) > 1:
+            new_plot.title = "Gen Theory for %s "% model.name + data_name
+        new_plot.name = new_plot.id
+        new_plot.label = new_plot.id
+        #theory_data = deepcopy(new_plot)
+        if self.parent.parent != None:
+            self.parent.parent.update_theory(data_id=new_plot.id,
+                                           theory=new_plot,
+                                           state=state)
+        title = new_plot.title
+        num_graph = str(self.graph_num)
+        wx.CallAfter(self.parent.draw_graph, new_plot, 
+                     title="Graph %s: "% num_graph + new_plot.id )
+        self.graph_num += 1
+                
     def _draw2D(self, image):
         """
@@ -995,6 +1125,7 @@
         new_plot.title = "Generic model 2D "
         new_plot.id = str(page_id) + ': ' + self.file_name \
-                        + ' #%s'% str(self.graph_num)
-        new_plot.group_id = str(page_id) + " Model2D"
+                        + ' #%s'% str(self.graph_num) + "_2D"
+        new_plot.group_id = str(page_id) + " Model2D" \
+                        + ' #%s'% str(self.graph_num) + "_2D"
         new_plot.detector = data.detector
         new_plot.source = data.source
Index: sanscalculator/src/sans/calculator/sans_gen.py
===================================================================
--- sanscalculator/src/sans/calculator/sans_gen.py	(revision 11363eeea607663b4f080837617cbdfb3519d1ce)
+++ sanscalculator/src/sans/calculator/sans_gen.py	(revision 9624cda0fe91bcf5da3751e7d23fa3047d7ffcb3)
@@ -30,4 +30,15 @@
     sld_m = factor * mag
     return sld_m
+
+def transform_center(pos_x, pos_y, pos_z):
+    """
+    re-center 
+    
+    :return: posx, posy, posz   [arrays]
+    """ 
+    posx = pos_x - (min(pos_x) + max(pos_x)) / 2.0
+    posy = pos_y - (min(pos_y) + max(pos_y)) / 2.0
+    posz = pos_z - (min(pos_z) + max(pos_z)) / 2.0  
+    return posx, posy, posz   
 
 class GenSAS(BaseComponent):
@@ -101,11 +112,15 @@
         :return: function value
         """
-        len_x = len(self.data_x)
-        if self.is_avg:
+        pos_x = self.data_x
+        pos_y = self.data_y
+        pos_z = self.data_z
+        len_x = len(pos_x)
+        if self.is_avg == None:
             len_x *= -1
+            pos_x, pos_y, pos_z = transform_center(pos_x, pos_y, pos_z)
         len_q = len(x)
         sldn = copy.deepcopy(self.data_sldn)
         sldn -= self.params['solvent_SLD']
-        model = mod.new_GenI(len_x, self.data_x, self.data_y, self.data_z, 
+        model = mod.new_GenI(len_x, pos_x, pos_y, pos_z, 
                              sldn, self.data_mx, self.data_my, 
                              self.data_mz, self.data_vol,
@@ -113,6 +128,8 @@
                              self.params['Up_frac_out'], 
                              self.params['Up_theta'])
-
-        mod.genicom(model, len_q, x, y, i)
+        if y == []:
+            mod.genicom(model, len_q, x, i)
+        else:
+            mod.genicomXY(model, len_q, x, y, i)
         vol_correction = self.data_total_volume / self.params['total_volume']
         return  self.params['scale'] * vol_correction * i + \
@@ -151,8 +168,14 @@
         """
         if x.__class__.__name__ == 'list':
+            if len(x[1]) > 0:
+                msg = "Not a 1D."
+                raise ValueError, msg
             i_out = numpy.zeros_like(x[0])
-            y_in = numpy.zeros_like(x[0])
+            #import time
+            #s = time.time()
             # 1D I is found at y =0 in the 2D pattern
-            return self._gen(x[0], y_in, i_out )
+            out = self._gen(x[0], [], i_out )
+            #print "i_out_time", time.time() - s
+            return out
         else:
             msg = "Q must be given as list of qx's and qy's"
@@ -168,8 +191,8 @@
         if x.__class__.__name__ == 'list':
             i_out = numpy.zeros_like(x[0])
-            import time
-            s = time.time()
+            #import time
+            #s = time.time()
             out = self._gen(x[0], x[1], i_out)
-            print "i_out_time", time.time() - s
+            #print "i_out_time", time.time() - s
             return out
         else:
@@ -189,5 +212,8 @@
         """
         if qdist.__class__.__name__ == 'list':
-            out = self.runXY(qdist)
+            if len(qdist[1]) < 1:
+                out = self.run(qdist)
+            else:
+                out = self.runXY(qdist)
             return out
         else:
Index: sansmodels/src/c_gen/sld2i.cpp
===================================================================
--- sansmodels/src/c_gen/sld2i.cpp	(revision 5917637bd3573f57e00e5c3c1e36514c40dc702d)
+++ sansmodels/src/c_gen/sld2i.cpp	(revision 9624cda0fe91bcf5da3751e7d23fa3047d7ffcb3)
@@ -50,11 +50,10 @@
 
 /**
- * Compute
- */
-void GenI :: genicom(int npoints, double *qx, double *qy, double *I_out){
+ * Compute 2D anisotropic
+ */
+void GenI :: genicomXY(int npoints, double *qx, double *qy, double *I_out){
 	//npoints is given negative for angular averaging 
 	// Assumes that q doesn't have qz component and sld_n is all real
-	double q = 0.0;
-	int is_avg = 0;
+	//double q = 0.0;
 	//double Pi = 4.0*atan(1.0);
 	polar_sld b_sld;
@@ -63,5 +62,5 @@
 	complex ephase = cassign(0.0, 0.0);
 	complex comp_sld = cassign(0.0, 0.0);
-	complex sumj;
+
 	complex sumj_uu;
 	complex sumj_ud;
@@ -72,17 +71,14 @@
 	double count = 0.0;
 	//check if this computation is for averaging
-	if (n_pix < 0 ){
-		is_avg = 1;
-		n_pix = fabs(n_pix);
-	}
+
 	//Assume that pixel volumes are given in vol_pix in A^3 unit
 	//int x_size = 0; //in Ang
 	//int y_size = 0; //in Ang
 	//int z_size = 0; //in Ang
+	
 	// Loop over q-values and multiply apply matrix
-
+	
 	for(int i=0; i<npoints; i++){
 		//I_out[i] = 0.0;
-		sumj = cassign(0.0, 0.0);
 		sumj_uu = cassign(0.0, 0.0);
 		sumj_ud = cassign(0.0, 0.0);
@@ -90,32 +86,18 @@
 		sumj_dd = cassign(0.0, 0.0);		
 		//printf ("%d ", i);
-		q = sqrt(qx[i]*qx[i] + qy[i]*qy[i]); // + qz[i]*qz[i]);
+		//q = sqrt(qx[i]*qx[i] + qy[i]*qy[i]); // + qz[i]*qz[i]);
 
 		for(int j=0; j<n_pix; j++){
-			
 			if (sldn_val[j]!=0.0||mx_val[j]!=0.0||my_val[j]!=0.0||mz_val[j]!=0.0)
 			{	
+				//anisotropic
 				temp_fi = cassign(0.0, 0.0);
 				b_sld = cal_msld(0, qx[i], qy[i], sldn_val[j],
-								 mx_val[j], my_val[j], mz_val[j],
-				 				 inspin, outspin, stheta);
-				if (is_avg < 1){
-					//anisotropic
-					qr = (qx[i]*x_val[j] + qy[i]*y_val[j]);
-					iqr = cassign(0.0, qr);
-					ephase = cplx_exp(iqr);
-					}
-				else{
-					//isotropic
-					qr = sqrt(x_val[j]*x_val[j]+y_val[j]*y_val[j]+z_val[j]*z_val[j]);
-					qr *= q;
-					if (qr == 0.0){
-						ephase = cassign(0.0, 1.0);
-						}
-					else{
-						qr = sin(qr) / qr;
-						ephase = cassign(qr, 0.0);
-						}
-					}
+							 mx_val[j], my_val[j], mz_val[j],
+			 				 inspin, outspin, stheta);
+				qr = (qx[i]*x_val[j] + qy[i]*y_val[j]);
+				iqr = cassign(0.0, qr);
+				ephase = cplx_exp(iqr);
+				
 				//Let's multiply pixel(atomic) volume here
 				ephase = rcmult(vol_pix[j], ephase);
@@ -125,5 +107,5 @@
 					temp_fi = cplx_mult(comp_sld, ephase);
 					sumj_uu = cplx_add(sumj_uu, temp_fi);
-					}
+				}
 				//down_down
 				if (inspin < 1.0 && outspin < 1.0){
@@ -131,5 +113,5 @@
 					temp_fi = cplx_mult(comp_sld, ephase);
 					sumj_dd = cplx_add(sumj_dd, temp_fi);
-					}
+				}
 				//up_down
 				if (inspin > 0.0 && outspin < 1.0){
@@ -137,5 +119,5 @@
 					temp_fi = cplx_mult(comp_sld, ephase);
 					sumj_ud = cplx_add(sumj_ud, temp_fi);
-					}
+				}
 				//down_up
 				if (inspin < 1.0 && outspin > 0.0){
@@ -143,5 +125,7 @@
 					temp_fi = cplx_mult(comp_sld, ephase);
 					sumj_du = cplx_add(sumj_du, temp_fi);
-					}
+				}
+
+
 				if (i == 0){
 					count += vol_pix[j];
@@ -150,10 +134,77 @@
 		}
 		//printf("aa%d=%g %g %d\n", i, (sumj_uu.re*sumj_uu.re + sumj_uu.im*sumj_uu.im), (sumj_dd.re*sumj_dd.re + sumj_dd.im*sumj_dd.im), count);
+
 		I_out[i] = (sumj_uu.re*sumj_uu.re + sumj_uu.im*sumj_uu.im);
 		I_out[i] += (sumj_ud.re*sumj_ud.re + sumj_ud.im*sumj_ud.im);
 		I_out[i] += (sumj_du.re*sumj_du.re + sumj_du.im*sumj_du.im);
 		I_out[i] += (sumj_dd.re*sumj_dd.re + sumj_dd.im*sumj_dd.im);
+
 		I_out[i] *= (1.0E+8 / count); //in cm (unit) / number; //to be multiplied by vol_pix
 	}
 	//printf ("count = %d %g %g %g %g\n", count, sldn_val[0],mx_val[0], my_val[0], mz_val[0]);
 }
+/**
+ * Compute 1D isotropic
+ * Isotropic: Assumes all slds are real (no magnetic)
+ * Also assumes there is no polarization: No dependency on spin
+ */
+void GenI :: genicom(int npoints, double *q, double *I_out){
+	//npoints is given negative for angular averaging 
+	// Assumes that q doesn't have qz component and sld_n is all real
+	//double Pi = 4.0*atan(1.0);
+	int is_sym = 0;
+	double qr = 0.0;
+	double sumj;
+	double sld_j = 0.0;
+	double count = 0.0;
+	if (n_pix < 0 ){
+		is_sym = 1;
+		n_pix = n_pix * -1;
+	}
+	//Assume that pixel volumes are given in vol_pix in A^3 unit
+	// Loop over q-values and multiply apply matrix
+	for(int i=0; i<npoints; i++){
+		sumj =0.0;		
+		for(int j=0; j<n_pix; j++){
+			//Isotropic: Assumes all slds are real (no magnetic)
+			//Also assumes there is no polarization: No dependency on spin
+			if (is_sym == 1){
+				// approximation for a spherical symmetric particle
+				qr = sqrt(x_val[j]*x_val[j]+y_val[j]*y_val[j]+z_val[j]*z_val[j])*q[i];
+				if (qr > 0.0){
+					qr = sin(qr) / qr;
+					sumj += sldn_val[j] * vol_pix[j] * qr;
+				}
+				else{
+					sumj += sldn_val[j] * vol_pix[j];
+				}
+			}
+			else{
+				//full calculation
+				#pragma omp parallel for
+				for(int k=0; k<n_pix; k++){
+					sld_j =  sldn_val[j] * sldn_val[k] * vol_pix[j] * vol_pix[k];
+					qr = (x_val[j]-x_val[k])*(x_val[j]-x_val[k])+
+						      (y_val[j]-y_val[k])*(y_val[j]-y_val[k])+ 
+						      (z_val[j]-z_val[k])*(z_val[j]-z_val[k]);
+					qr = sqrt(qr) * q[i];
+					if (qr > 0.0){
+						sumj += sld_j*sin(qr)/qr;
+					}
+					else{
+						sumj += sld_j;
+					}
+				}
+			}
+			if (i == 0){
+				count += vol_pix[j];
+			}
+		}
+		I_out[i] = sumj;
+		if (is_sym == 1){
+			I_out[i] *= sumj;
+		}
+		I_out[i] *= (1.0E+8 / count); //in cm (unit) / number; //to be multiplied by vol_pix
+	}
+	//printf ("count = %d %g %g %g %g\n", count, sldn_val[0],mx_val[0], my_val[0], mz_val[0]);
+}
Index: sansmodels/src/c_gen/sld2i.hh
===================================================================
--- sansmodels/src/c_gen/sld2i.hh	(revision b1174ec4ec9164d6823c827cb03dad5e55b43a97)
+++ sansmodels/src/c_gen/sld2i.hh	(revision 9624cda0fe91bcf5da3751e7d23fa3047d7ffcb3)
@@ -39,5 +39,6 @@
 			double s_theta);
 	// compute function
-	virtual void genicom(int npoints, double* qx, double* qy, double *I_out);
+	virtual void genicomXY(int npoints, double* qx, double* qy, double *I_out);
+	virtual void genicom(int npoints, double* q, double *I_out);
 };
 
Index: sansmodels/src/c_gen/sld2i_module.cpp
===================================================================
--- sansmodels/src/c_gen/sld2i_module.cpp	(revision b1174ec4ec9164d6823c827cb03dad5e55b43a97)
+++ sansmodels/src/c_gen/sld2i_module.cpp	(revision 9624cda0fe91bcf5da3751e7d23fa3047d7ffcb3)
@@ -75,7 +75,7 @@
 
 /**
- * GenI the given input according to a given object
+ * GenI the given input (2D) according to a given object
  */
-PyObject * genicom_input(PyObject *, PyObject *args) {
+PyObject * genicom_inputXY(PyObject *, PyObject *args) {
 	int npoints;
 	PyObject *qx_obj;
@@ -100,9 +100,36 @@
 	GenI* s = static_cast<GenI *>(temp);
 
-	s->genicom(npoints, qx, qy, I_out);
+	s->genicomXY(npoints, qx, qy, I_out);
 	//return PyCObject_FromVoidPtr(s, del_genicom);
 	return Py_BuildValue("i",1);
 }
 
+/**
+ * GenI the given 1D input according to a given object
+ */
+PyObject * genicom_input(PyObject *, PyObject *args) {
+	int npoints;
+	PyObject *q_obj;
+	double *q;
+	PyObject *I_out_obj;
+	Py_ssize_t n_out;
+	double *I_out;
+	PyObject *gen_obj;
+
+	if (!PyArg_ParseTuple(args, "OiOO",  &gen_obj, &npoints, &q_obj, &I_out_obj)) return NULL;
+	OUTVECTOR(q_obj, q, n_out);
+	OUTVECTOR(I_out_obj, I_out, n_out);
+
+	// Sanity check
+	//if(n_in!=n_out) return Py_BuildValue("i",-1);
+
+	// Set the array pointers
+	void *temp = PyCObject_AsVoidPtr(gen_obj);
+	GenI* s = static_cast<GenI *>(temp);
+
+	s->genicom(npoints, q, I_out);
+	//return PyCObject_FromVoidPtr(s, del_genicom);
+	return Py_BuildValue("i",1);
+}
 
 /**
@@ -113,5 +140,7 @@
 		  "Create a new GenI object"},
 	{"genicom",(PyCFunction)genicom_input, METH_VARARGS,
-		  "genicom the given input arrays"},
+		  "genicom the given 1d input arrays"},
+	{"genicomXY",(PyCFunction)genicom_inputXY, METH_VARARGS,
+		  "genicomXY the given 2d input arrays"},
     {NULL}
 };
