Index: palm/trunk/SCRIPTS/palm_gf_files/palm_gf_table.ui
===================================================================
--- palm/trunk/SCRIPTS/palm_gf_files/palm_gf_table.ui	(revision 2308)
+++ palm/trunk/SCRIPTS/palm_gf_files/palm_gf_table.ui	(revision 2309)
@@ -7,5 +7,5 @@
     <x>0</x>
     <y>0</y>
-    <width>817</width>
+    <width>1030</width>
     <height>439</height>
    </rect>
@@ -19,5 +19,5 @@
      <x>5</x>
      <y>166</y>
-     <width>805</width>
+     <width>1005</width>
      <height>266</height>
     </rect>
@@ -55,4 +55,7 @@
    <property name="rowCount">
     <number>8</number>
+   </property>
+   <property name="columnCount">
+    <number>10</number>
    </property>
    <attribute name="horizontalHeaderVisible">
@@ -72,5 +75,5 @@
    <row>
     <property name="text">
-     <string>2</string>
+     <string>8</string>
     </property>
    </row>
@@ -141,9 +144,11 @@
     </property>
    </column>
+   <column/>
+   <column/>
   </widget>
   <widget class="Line" name="line">
    <property name="geometry">
     <rect>
-     <x>655</x>
+     <x>831</x>
      <y>60</y>
      <width>30</width>
@@ -158,5 +163,5 @@
    <property name="geometry">
     <rect>
-     <x>675</x>
+     <x>851</x>
      <y>112</y>
      <width>131</width>
@@ -750,5 +755,5 @@
    <property name="geometry">
     <rect>
-     <x>675</x>
+     <x>851</x>
      <y>70</y>
      <width>52</width>
@@ -763,5 +768,5 @@
    <property name="geometry">
     <rect>
-     <x>675</x>
+     <x>851</x>
      <y>90</y>
      <width>131</width>
@@ -1229,4 +1234,150 @@
    </layout>
   </widget>
+  <widget class="QPushButton" name="nxpex_table">
+   <property name="geometry">
+    <rect>
+     <x>806</x>
+     <y>149</y>
+     <width>104</width>
+     <height>23</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>nx+1 / npex</string>
+   </property>
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="nypey_table">
+   <property name="geometry">
+    <rect>
+     <x>907</x>
+     <y>149</y>
+     <width>104</width>
+     <height>23</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>ny+1 / npey</string>
+   </property>
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_13">
+   <property name="geometry">
+    <rect>
+     <x>677</x>
+     <y>67</y>
+     <width>57</width>
+     <height>19</height>
+    </rect>
+   </property>
+   <property name="sizePolicy">
+    <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+     <horstretch>0</horstretch>
+     <verstretch>0</verstretch>
+    </sizepolicy>
+   </property>
+   <property name="minimumSize">
+    <size>
+     <width>57</width>
+     <height>19</height>
+    </size>
+   </property>
+   <property name="maximumSize">
+    <size>
+     <width>57</width>
+     <height>19</height>
+    </size>
+   </property>
+   <property name="text">
+    <string>nx / npex</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_14">
+   <property name="geometry">
+    <rect>
+     <x>755</x>
+     <y>67</y>
+     <width>57</width>
+     <height>19</height>
+    </rect>
+   </property>
+   <property name="sizePolicy">
+    <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+     <horstretch>0</horstretch>
+     <verstretch>0</verstretch>
+    </sizepolicy>
+   </property>
+   <property name="minimumSize">
+    <size>
+     <width>57</width>
+     <height>19</height>
+    </size>
+   </property>
+   <property name="maximumSize">
+    <size>
+     <width>57</width>
+     <height>19</height>
+    </size>
+   </property>
+   <property name="text">
+    <string>ny / npey</string>
+   </property>
+  </widget>
+  <widget class="QDoubleSpinBox" name="nxpex_min">
+   <property name="geometry">
+    <rect>
+     <x>670</x>
+     <y>86</y>
+     <width>71</width>
+     <height>22</height>
+    </rect>
+   </property>
+   <property name="maximum">
+    <double>1000000.000000000000000</double>
+   </property>
+  </widget>
+  <widget class="QDoubleSpinBox" name="nxpex_max">
+   <property name="geometry">
+    <rect>
+     <x>670</x>
+     <y>110</y>
+     <width>71</width>
+     <height>22</height>
+    </rect>
+   </property>
+   <property name="maximum">
+    <double>1000000.000000000000000</double>
+   </property>
+  </widget>
+  <widget class="QDoubleSpinBox" name="nypey_min">
+   <property name="geometry">
+    <rect>
+     <x>747</x>
+     <y>86</y>
+     <width>71</width>
+     <height>22</height>
+    </rect>
+   </property>
+   <property name="maximum">
+    <double>1000000.000000000000000</double>
+   </property>
+  </widget>
+  <widget class="QDoubleSpinBox" name="nypey_max">
+   <property name="geometry">
+    <rect>
+     <x>747</x>
+     <y>110</y>
+     <width>71</width>
+     <height>22</height>
+    </rect>
+   </property>
+   <property name="maximum">
+    <double>1000000.000000000000000</double>
+   </property>
+  </widget>
  </widget>
  <tabstops>
Index: palm/trunk/SCRIPTS/palm_gf_files/palm_gf_tools.py
===================================================================
--- palm/trunk/SCRIPTS/palm_gf_files/palm_gf_tools.py	(revision 2308)
+++ palm/trunk/SCRIPTS/palm_gf_files/palm_gf_tools.py	(revision 2309)
@@ -60,4 +60,6 @@
         self.np_table.clicked.connect(lambda: self.sort_table(str("np")))
         self.ngpts_table.clicked.connect(lambda: self.sort_table(str("ngpts")))
+        self.nxpex_table.clicked.connect(lambda: self.sort_table(str("nxnpex")))
+        self.nypey_table.clicked.connect(lambda: self.sort_table(str("nynpey")))
 
         self.instant()
@@ -83,5 +85,7 @@
         dtb = str('.palm_gf_data.db')
         #con = sqlite3.connect("/localdata/.palm_gf_data.db")
-        con = sqlite3.connect(pathx + '.palm_gf_data.db')
+
+        pathx = pathx + '/.palm_gf_data.db'
+        con = sqlite3.connect(pathx)
         c = con.cursor()
         c.execute("SELECT * FROM " + 'grid_limits')
@@ -90,4 +94,5 @@
         self.nx_min.setValue(mini[0])
         self.nx_max.setValue(max[0])
+
         self.ny_min.setValue(mini[1])
         self.ny_max.setValue(max[1])
@@ -104,4 +109,8 @@
         self.ngpts_min.setValue(mini[7])
         self.ngpts_max.setValue(max[7])
+        self.nxpex_min.setValue(mini[8])
+        self.nxpex_max.setValue(max[8])
+        self.nypey_min.setValue(mini[9])
+        self.nypey_max.setValue(max[9])
 
         self.nx_min.setMinimum(mini[0])
@@ -119,4 +128,5 @@
         self.np_min.setMinimum(mini[6])
         self.np_max.setMaximum(max[6])
+
         self.ngpts_min.setMinimum(mini[7])
         self.ngpts_max.setMaximum(max[7])
@@ -124,4 +134,16 @@
         self.ngpts_max.setMinimum(mini[7])
 
+        self.nxpex_min.setMinimum(mini[8])
+        self.nxpex_max.setMaximum(max[8])
+        self.nxpex_min.setMaximum(max[8])
+        self.nxpex_max.setMinimum(mini[8])
+
+        self.nypey_min.setMinimum(mini[9])
+        self.nypey_max.setMaximum(max[9])
+        self.nypey_min.setMaximum(max[9])
+        self.nypey_max.setMinimum(mini[9])
+
+
+
 
 
@@ -134,6 +156,10 @@
 
     def check(self):
+        pathx = configwr.read_config()
+        pathx = pathx[19]
+
         dtb = str('.palm_gf_data.db')
-        con = sqlite3.connect("/localdata/.palm_gf_data.db")
+        #con = sqlite3.connect("/localdata/.palm_gf_data.db")
+        con = sqlite3.connect(pathx + '/.palm_gf_data.db')
         c = con.cursor()
         c.execute("SELECT * FROM " + 'grid_limits')
@@ -154,4 +180,8 @@
         #print("LOADED!!!")
         import decimal
+
+        pathx = configwr.read_config()
+        pathx = pathx[19]
+
         self.setEnabled(False)
         QtGui.QApplication.processEvents()
@@ -159,5 +189,5 @@
         self.process1()
         database = str('.palm_gf_data.db')
-        conn = sqlite3.connect("/localdata/.palm_gf_data.db")
+        conn = sqlite3.connect(pathx + '/.palm_gf_data.db')
         c = conn.cursor()
         c.execute("SELECT * FROM " + 'grid_current')
@@ -172,5 +202,5 @@
         while i < len(results):
             line = results[i]
-            while j < 8:
+            while j < 10:
                 var = line[j]
 
@@ -202,9 +232,12 @@
     def filter_results(self):
 
+        pathx = configwr.read_config()
+        pathx = pathx[19]
+
         self.setEnabled(False)
         self.calc_label.setText('calculating...')
         QtGui.QApplication.processEvents()
         database = str('.palm_gf_data.db')
-        conn = sqlite3.connect("/localdata/.palm_gf_data.db")
+        conn = sqlite3.connect(pathx + '/.palm_gf_data.db')
         c = conn.cursor()
         c.execute("SELECT * FROM " + "grid_current")
@@ -252,15 +285,23 @@
                                                                         if line[7] >= self.ngpts_min.value():
 
-                                                                            row_cnt += 1
-                                                                            while j < 8:
-                                                                                var = line[j]
-
-                                                                                if j == 7:
-                                                                                    self.tableWidget.setItem(row_cnt, j, self.MyTableWidgetItem(str("%.1e" % var), i))
-
-                                                                                else:
-                                                                                    self.tableWidget.setItem(row_cnt, j, self.MyTableWidgetItem(str(var), i))
-
-                                                                                j += 1
+                                                                            if line[8] <= self.nxpex_max.value():
+
+                                                                                if line[8] >= self.nxpex_min.value():
+
+                                                                                    if line[9] <= self.nypey_max.value():
+
+                                                                                        if line[9] >= self.nypey_min.value():
+
+                                                                                            row_cnt += 1
+                                                                                            while j < 10:
+                                                                                                var = line[j]
+
+                                                                                                if j == 7:
+                                                                                                    self.tableWidget.setItem(row_cnt, j, self.MyTableWidgetItem(str("%.1e" % var), i))
+
+                                                                                                else:
+                                                                                                    self.tableWidget.setItem(row_cnt, j, self.MyTableWidgetItem(str(var), i))
+
+                                                                                                j += 1
 
             j = 0
@@ -295,4 +336,9 @@
         fngpts_mn = self.ngpts_min.value()
         fngpts_mx = self.ngpts_max.value()
+        nxpex_mn = self.nxpex_min.value()
+        nxpex_mx = self.nxpex_max.value()
+        nypey_mn = self.nypey_min.value()
+        nypey_mx = self.nypey_max.value()
+
 
         if column == str("nx"):
@@ -313,4 +359,6 @@
             self.np_table.setChecked(False)
             self.ngpts_table.setChecked(False)
+            self.nxpex_table.setChecked(False)
+            self.nypey_table.setChecked(False)
 
         if column == str("ny"):
@@ -331,4 +379,6 @@
             self.np_table.setChecked(False)
             self.ngpts_table.setChecked(False)
+            self.nxpex_table.setChecked(False)
+            self.nypey_table.setChecked(False)
 
         if column == str("nz"):
@@ -349,4 +399,6 @@
             self.np_table.setChecked(False)
             self.ngpts_table.setChecked(False)
+            self.nxpex_table.setChecked(False)
+            self.nypey_table.setChecked(False)
 
         if column == str("npex"):
@@ -367,4 +419,6 @@
             self.np_table.setChecked(False)
             self.ngpts_table.setChecked(False)
+            self.nxpex_table.setChecked(False)
+            self.nypey_table.setChecked(False)
 
         if column == str("npey"):
@@ -386,4 +440,6 @@
             self.np_table.setChecked(False)
             self.ngpts_table.setChecked(False)
+            self.nxpex_table.setChecked(False)
+            self.nypey_table.setChecked(False)
 
         if column == str("npexnpey"):
@@ -404,4 +460,6 @@
             self.np_table.setChecked(False)
             self.ngpts_table.setChecked(False)
+            self.nxpex_table.setChecked(False)
+            self.nypey_table.setChecked(False)
 
         if column == str("np"):
@@ -422,4 +480,6 @@
             self.nx_table.setChecked(False)
             self.ngpts_table.setChecked(False)
+            self.nxpex_table.setChecked(False)
+            self.nypey_table.setChecked(False)
 
         if column == str("ngpts"):
@@ -440,8 +500,55 @@
             self.np_table.setChecked(False)
             self.nx_table.setChecked(False)
-
-
-
-        conn = sqlite3.connect("/localdata/.palm_gf_data.db")
+            self.nxpex_table.setChecked(False)
+            self.nypey_table.setChecked(False)
+
+        if column == str("nxnpex"):
+            sorted_col = "nxnpex"
+
+            if self.nxpex_table.isChecked() is True:
+                order = " DESC"
+
+            else:
+
+                order = " ASC"
+
+            self.ny_table.setChecked(False)
+            self.nz_table.setChecked(False)
+            self.npex_table.setChecked(False)
+            self.npey_table.setChecked(False)
+            self.npexnpey_table.setChecked(False)
+            self.np_table.setChecked(False)
+            self.nx_table.setChecked(False)
+            self.ngpts_table.setChecked(False)
+            self.nypey_table.setChecked(False)
+
+        if column == str("nynpey"):
+            sorted_col = "nynpey"
+
+            if self.nypey_table.isChecked() is True:
+                order = " DESC"
+
+            else:
+
+                order = " ASC"
+
+            self.ny_table.setChecked(False)
+            self.nz_table.setChecked(False)
+            self.npex_table.setChecked(False)
+            self.npey_table.setChecked(False)
+            self.npexnpey_table.setChecked(False)
+            self.np_table.setChecked(False)
+            self.nx_table.setChecked(False)
+            self.ngpts_table.setChecked(False)
+            self.nxpex_table.setChecked(False)
+
+        else:
+            pass
+
+        pathx = configwr.read_config()
+        pathx = pathx[19]
+
+
+        conn = sqlite3.connect(pathx + "/.palm_gf_data.db")
         c = conn.cursor()
         c.execute("SELECT * FROM grid_current  WHERE nx <= " + str(fnx_mx) + " AND nx >= "  + str(fnx_mn) + " AND ny <= " + str(fny_mx) + " AND ny >= " + str(fny_mn) + " AND nz <= " + str(fnz_mx) +
@@ -449,4 +556,5 @@
         str(fnpex_mn) + " AND npey <= " + str(fnpey_mx) + " AND npey >= " + str(fnpey_mn) + " AND "
                   "npxnpy <= " + str(fnpxnpy_mx) + " AND npxnpy >= " + str(fnpxnpy_mn) + " AND np <= " + str(fnp_mx) + " AND np >= " + str(fnp_mn) + " AND ngpts <= " + str(fngpts_mx) + " AND ngpts >= " + str(fngpts_mn) +
+        " AND nxnpex <= " + str(nxpex_mx) + " AND nxnpex >= " + str(nxpex_mn) + " AND nynpey <= " + str(nypey_mx) + " AND nynpey >= " + str(nypey_mn) +
         " ORDER BY " + str(sorted_col) + str(order))
 
@@ -454,4 +562,5 @@
 
         sorted = c.fetchall()
+
 
         c.close()
@@ -461,5 +570,5 @@
         for row_indx in range(0,len(sorted)):
 
-            for col_indx in range(0,8):
+            for col_indx in range(0,10):
                 row = sorted[row_indx]
                 value = row[col_indx]
