Index: palm/trunk/SCRIPTS/palm_gf_files/alternative_logic.py
===================================================================
--- palm/trunk/SCRIPTS/palm_gf_files/alternative_logic.py	(revision 4869)
+++ palm/trunk/SCRIPTS/palm_gf_files/alternative_logic.py	(revision 4869)
@@ -0,0 +1,72 @@
+ 
+
+    def get_allowed_number_of_cores_for_grid(self, grid, min_procs, max_procs):
+
+        nx = grid.nx - 1
+        ny = grid.ny - 1
+        nz = grid.nz - 1
+
+        anc = list()
+        for np_used in range(min_procs, max_procs+1):
+
+            for npex in range(1, np_used+1):
+
+                allowed = True
+
+                # strict matching in nodes (all nodes are used completely)
+                if self.tasks_per_node != 0:
+                    if np_used % self.tasks_per_node != 0:
+                        allowed = False
+
+                if np_used % npex != 0:
+                    allowed = False
+
+                npey = int(np_used / npex)
+
+                # if fixed ratio is requested
+                if self.npex_d_npey != 0.0 and npex / npey != self.npex_d_npey:
+                    allowed = False
+
+                # nx restlos teilbar auf npex
+                if (nx + 1) % npex != 0:
+                    allowed = False
+                # ny restlos teilbar auf npey
+                if (ny + 1) % npey != 0:
+                    allowed = False
+
+                if self.nx_d_ny != 0.0 and float(nx) / float(ny) != float(self.nx_d_ny):
+                    allowed = False
+
+                if self.multi_grid is True and (nx + 1) % 2 != 0:
+                    allowed = False
+                if self.multi_grid is True and (ny + 1) % 2 != 0:
+                    allowed = False
+                if self.multi_grid is True and nz % 2 != 0:
+                    allowed = False
+
+                if self.switch is True and (nx + 1) % npey != 0:
+                    allowed = False
+                if self.switch is True and (ny + 1) % npex != 0:
+                    allowed = False
+
+                if self.poisfft is True and nz % npex != 0:
+                    allowed = False
+
+                if npex > nx:
+                    allowed = False
+                if npey > ny:
+                    allowed = False
+
+                if self.spectra is True and nz % npey != 0:
+                    allowed = False
+
+                if self.tempterton is True and nx > 1 and ny > 1 and self.temperton_check(nx, ny) == 0:
+                    allowed = False
+
+                npxnpy = format(float(npex) / float(npey), '.2f')
+                nxpex = float(nx + 1) / float(npex)
+                nypey = float(ny + 1) / float(npey)
+
+                if allowed:
+                    anc.append((nx, ny, nz, npex, npey, npxnpy, (npex * npey), (nx * ny * nz), nxpex, nypey))
+        return anc
Index: palm/trunk/SCRIPTS/palm_gf_files/palm_gf.ui
===================================================================
--- palm/trunk/SCRIPTS/palm_gf_files/palm_gf.ui	(revision 4843)
+++ palm/trunk/SCRIPTS/palm_gf_files/palm_gf.ui	(revision 4869)
@@ -3,965 +3,158 @@
  <class>MainWindow</class>
  <widget class="QMainWindow" name="MainWindow">
-  <property name="windowModality">
-   <enum>Qt::WindowModal</enum>
-  </property>
-  <property name="enabled">
-   <bool>true</bool>
-  </property>
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>584</width>
-    <height>386</height>
+    <width>797</width>
+    <height>500</height>
    </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <property name="minimumSize">
-   <size>
-    <width>584</width>
-    <height>375</height>
-   </size>
-  </property>
-  <property name="maximumSize">
-   <size>
-    <width>584</width>
-    <height>622</height>
-   </size>
   </property>
   <property name="windowTitle">
    <string>MainWindow</string>
   </property>
+  <property name="layoutDirection">
+   <enum>Qt::LeftToRight</enum>
+  </property>
+  <property name="locale">
+   <locale language="German" country="Germany"/>
+  </property>
+  <property name="dockOptions">
+   <set>QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks</set>
+  </property>
   <widget class="QWidget" name="centralwidget">
-   <widget class="QFrame" name="frame_2">
+   <widget class="QWidget" name="gridLayoutWidget">
+    <property name="geometry">
+     <rect>
+      <x>85</x>
+      <y>60</y>
+      <width>361</width>
+      <height>111</height>
+     </rect>
+    </property>
+    <layout class="QGridLayout" name="grid_layout_1">
+     <property name="sizeConstraint">
+      <enum>QLayout::SetDefaultConstraint</enum>
+     </property>
+     <property name="leftMargin">
+      <number>5</number>
+     </property>
+     <property name="topMargin">
+      <number>0</number>
+     </property>
+     <property name="rightMargin">
+      <number>5</number>
+     </property>
+     <property name="bottomMargin">
+      <number>5</number>
+     </property>
+     <property name="horizontalSpacing">
+      <number>25</number>
+     </property>
+     <item row="0" column="2">
+      <widget class="QSpinBox" name="nz_min_box">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>24</height>
+        </size>
+       </property>
+       <property name="minimum">
+        <number>0</number>
+       </property>
+       <property name="maximum">
+        <number>99999999</number>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="2">
+      <widget class="QSpinBox" name="nz_max_box">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>24</height>
+        </size>
+       </property>
+       <property name="minimum">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <number>99999999</number>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QSpinBox" name="ny_min_box">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>24</height>
+        </size>
+       </property>
+       <property name="minimum">
+        <number>0</number>
+       </property>
+       <property name="maximum">
+        <number>99999999</number>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="QSpinBox" name="ny_max_box">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>24</height>
+        </size>
+       </property>
+       <property name="minimum">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <number>99999999</number>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0">
+      <widget class="QSpinBox" name="nx_max_box">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>24</height>
+        </size>
+       </property>
+       <property name="minimum">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <number>99999999</number>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="0">
+      <widget class="QSpinBox" name="nx_min_box">
+       <property name="minimumSize">
+        <size>
+         <width>25</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="minimum">
+        <number>0</number>
+       </property>
+       <property name="maximum">
+        <number>99999999</number>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+   <widget class="QLabel" name="grid_header_label">
     <property name="geometry">
      <rect>
       <x>0</x>
-      <y>0</y>
-      <width>361</width>
-      <height>201</height>
-     </rect>
-    </property>
-    <property name="frameShape">
-     <enum>QFrame::StyledPanel</enum>
-    </property>
-    <property name="frameShadow">
-     <enum>QFrame::Raised</enum>
-    </property>
-    <widget class="QLabel" name="label">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>10</y>
-       <width>237</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="font">
-      <font>
-       <weight>75</weight>
-       <bold>true</bold>
-      </font>
-     </property>
-     <property name="text">
-      <string>Define numerical grid</string>
-     </property>
-    </widget>
-    <widget class="QWidget" name="horizontalLayoutWidget_2">
-     <property name="geometry">
-      <rect>
-       <x>70</x>
-       <y>60</y>
-       <width>283</width>
-       <height>41</height>
-      </rect>
-     </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_2">
-      <item>
-       <widget class="QSpinBox" name="nx_min_box">
-        <property name="toolTip">
-         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Minimum of number of Gridpoints in X-direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-        <property name="minimum">
-         <number>1</number>
-        </property>
-        <property name="maximum">
-         <number>100000</number>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QSpinBox" name="ny_min_box">
-        <property name="toolTip">
-         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Minimum of number of Gridpoints in Y-direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-        <property name="minimum">
-         <number>1</number>
-        </property>
-        <property name="maximum">
-         <number>100000</number>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QSpinBox" name="nz_min_box">
-        <property name="toolTip">
-         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Minimum of number of Gridpoints in Z-direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-        <property name="minimum">
-         <number>1</number>
-        </property>
-        <property name="maximum">
-         <number>100000</number>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-    <widget class="QWidget" name="horizontalLayoutWidget_3">
-     <property name="geometry">
-      <rect>
-       <x>70</x>
-       <y>100</y>
-       <width>283</width>
-       <height>41</height>
-      </rect>
-     </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_3">
-      <item>
-       <widget class="QSpinBox" name="nx_max_box">
-        <property name="toolTip">
-         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Maximum of number of Gridpoints in X-direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-        <property name="autoFillBackground">
-         <bool>false</bool>
-        </property>
-        <property name="styleSheet">
-         <string notr="true"/>
-        </property>
-        <property name="frame">
-         <bool>true</bool>
-        </property>
-        <property name="minimum">
-         <number>1</number>
-        </property>
-        <property name="maximum">
-         <number>100000</number>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QSpinBox" name="ny_max_box">
-        <property name="toolTip">
-         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Maxmimum of number of Gridpoints in Y-direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-        <property name="minimum">
-         <number>1</number>
-        </property>
-        <property name="maximum">
-         <number>100000</number>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QSpinBox" name="nz_max_box">
-        <property name="toolTip">
-         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Maximum of number of Gridpoints in Z-direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-        <property name="minimum">
-         <number>1</number>
-        </property>
-        <property name="maximum">
-         <number>100000</number>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-    <widget class="QDoubleSpinBox" name="dnxny_box">
-     <property name="geometry">
-      <rect>
-       <x>150</x>
-       <y>160</y>
-       <width>72</width>
-       <height>22</height>
-      </rect>
-     </property>
-     <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Defines Ratio between the number of Gridpoints in X- and Y-direction.&lt;/p&gt;&lt;p&gt;If nx/ny = 0 , option is deactivated&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-     <property name="maximum">
-      <double>1000.000000000000000</double>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_11">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>160</y>
-       <width>149</width>
-       <height>21</height>
-      </rect>
-     </property>
-     <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Defines Ratio between the number of Gridpoints in X- and Y-direction.&lt;/p&gt;&lt;p&gt;If nx/ny = 0 , option is deactivated&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-     <property name="text">
-      <string>Set fixed ratio (nx / ny):</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_3">
-     <property name="enabled">
-      <bool>true</bool>
-     </property>
-     <property name="geometry">
-      <rect>
-       <x>70</x>
-       <y>41</y>
-       <width>86</width>
-       <height>27</height>
-      </rect>
-     </property>
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>24</height>
-      </size>
-     </property>
-     <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of Gridpoints in X-direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-     <property name="text">
-      <string>  nx</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_5">
-     <property name="geometry">
-      <rect>
-       <x>260</x>
-       <y>41</y>
-       <width>41</width>
-       <height>27</height>
-      </rect>
-     </property>
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>24</height>
-      </size>
-     </property>
-     <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of Gridpoints in Y-direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-     <property name="text">
-      <string>   nz</string>
-     </property>
-     <property name="scaledContents">
-      <bool>false</bool>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_4">
-     <property name="geometry">
-      <rect>
-       <x>162</x>
-       <y>41</y>
-       <width>41</width>
-       <height>27</height>
-      </rect>
-     </property>
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>27</height>
-      </size>
-     </property>
-     <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of Gridpoints in Z-direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-     <property name="text">
-      <string>    ny</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_6">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>60</y>
-       <width>80</width>
-       <height>37</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>Minimum</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_7">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>104</y>
-       <width>83</width>
-       <height>31</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>Maximum</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="warning_label">
-     <property name="geometry">
-      <rect>
-       <x>230</x>
-       <y>155</y>
-       <width>121</width>
-       <height>31</height>
-      </rect>
-     </property>
-     <property name="autoFillBackground">
-      <bool>false</bool>
-     </property>
-     <property name="styleSheet">
-      <string notr="true"/>
-     </property>
-     <property name="text">
-      <string>Input error! Min &gt; Max</string>
-     </property>
-    </widget>
-   </widget>
-   <widget class="QFrame" name="frame">
-    <property name="geometry">
-     <rect>
-      <x>360</x>
-      <y>0</y>
-      <width>211</width>
-      <height>221</height>
-     </rect>
-    </property>
-    <property name="frameShape">
-     <enum>QFrame::StyledPanel</enum>
-    </property>
-    <property name="frameShadow">
-     <enum>QFrame::Raised</enum>
-    </property>
-    <widget class="QLabel" name="label_2">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>10</y>
-       <width>204</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="font">
-      <font>
-       <weight>75</weight>
-       <bold>true</bold>
-      </font>
-     </property>
-     <property name="text">
-      <string>Define processor topology</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_14">
-     <property name="geometry">
-      <rect>
-       <x>20</x>
-       <y>40</y>
-       <width>141</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>141</width>
-       <height>16</height>
-      </size>
-     </property>
-     <property name="maximumSize">
-      <size>
-       <width>141</width>
-       <height>16</height>
-      </size>
-     </property>
-     <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of processors used for calculation.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-     <property name="text">
-      <string>Number of processors:</string>
-     </property>
-    </widget>
-    <widget class="Line" name="line">
-     <property name="geometry">
-      <rect>
-       <x>0</x>
-       <y>105</y>
-       <width>201</width>
-       <height>31</height>
-      </rect>
-     </property>
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_20">
-     <property name="geometry">
-      <rect>
-       <x>22</x>
-       <y>61</y>
-       <width>89</width>
-       <height>22</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>Minimum</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_21">
-     <property name="geometry">
-      <rect>
-       <x>22</x>
-       <y>94</y>
-       <width>61</width>
-       <height>21</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>Maximum</string>
-     </property>
-    </widget>
-    <widget class="QSpinBox" name="np_max_box">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>90</y>
-       <width>83</width>
-       <height>25</height>
-      </rect>
-     </property>
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>83</width>
-       <height>25</height>
-      </size>
-     </property>
-     <property name="maximumSize">
-      <size>
-       <width>83</width>
-       <height>25</height>
-      </size>
-     </property>
-     <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Maximum of number of processors used for calculation.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-     <property name="minimum">
-      <number>1</number>
-     </property>
-     <property name="maximum">
-      <number>10000000</number>
-     </property>
-    </widget>
-    <widget class="QSpinBox" name="np_min_box">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>59</y>
-       <width>83</width>
-       <height>25</height>
-      </rect>
-     </property>
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>83</width>
-       <height>25</height>
-      </size>
-     </property>
-     <property name="maximumSize">
-      <size>
-       <width>83</width>
-       <height>25</height>
-      </size>
-     </property>
-     <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Minimum of number of processors used for calculation.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-     <property name="minimum">
-      <number>1</number>
-     </property>
-     <property name="maximum">
-      <number>10000</number>
-     </property>
-    </widget>
-    <widget class="QWidget" name="layoutWidget">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>130</y>
-       <width>182</width>
-       <height>27</height>
-      </rect>
-     </property>
-     <layout class="QHBoxLayout" name="horizontalLayout">
-      <item>
-       <widget class="QCheckBox" name="strict_box">
-        <property name="toolTip">
-         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Fixed value for the tasks per node&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-        <property name="text">
-         <string>Strict Matching</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QSpinBox" name="tpn_box">
-        <property name="enabled">
-         <bool>true</bool>
-        </property>
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="minimumSize">
-         <size>
-          <width>72</width>
-          <height>25</height>
-         </size>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>72</width>
-          <height>25</height>
-         </size>
-        </property>
-        <property name="toolTip">
-         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Fixed value for the tasks per node&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-        <property name="maximum">
-         <number>10000</number>
-        </property>
-        <property name="value">
-         <number>24</number>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-    <widget class="QSlider" name="tolerance_bar">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>190</y>
-       <width>121</width>
-       <height>23</height>
-      </rect>
-     </property>
-     <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Tolerance for npex / npey&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-     <property name="value">
-      <number>10</number>
-     </property>
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-    <widget class="QSpinBox" name="tolerance_value">
-     <property name="geometry">
-      <rect>
-       <x>131</x>
-       <y>190</y>
-       <width>61</width>
-       <height>22</height>
-      </rect>
-     </property>
-     <property name="toolTip">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Tolerance for npex / npey in percent&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-     <property name="value">
-      <number>10</number>
-     </property>
-    </widget>
-    <widget class="QWidget" name="layoutWidget">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>160</y>
-       <width>181</width>
-       <height>27</height>
-      </rect>
-     </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_4">
-      <item>
-       <widget class="QCheckBox" name="npex_npey_box">
-        <property name="text">
-         <string>npex / npey</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QDoubleSpinBox" name="d_box">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="minimumSize">
-         <size>
-          <width>72</width>
-          <height>25</height>
-         </size>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>72</width>
-          <height>25</height>
-         </size>
-        </property>
-        <property name="maximum">
-         <double>1000.000000000000000</double>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </widget>
-   <widget class="QFrame" name="frame_3">
-    <property name="geometry">
-     <rect>
-      <x>0</x>
-      <y>200</y>
-      <width>172</width>
-      <height>131</height>
-     </rect>
-    </property>
-    <property name="frameShape">
-     <enum>QFrame::StyledPanel</enum>
-    </property>
-    <property name="frameShadow">
-     <enum>QFrame::Raised</enum>
-    </property>
-    <widget class="QLabel" name="label_9">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>10</y>
-       <width>161</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="font">
-      <font>
-       <weight>75</weight>
-       <bold>true</bold>
-      </font>
-     </property>
-     <property name="text">
-      <string>Pressure solver</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_12">
-     <property name="geometry">
-      <rect>
-       <x>12</x>
-       <y>37</y>
-       <width>119</width>
-       <height>15</height>
-      </rect>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>1</width>
-       <height>0</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Method (psolver):</string>
-     </property>
-    </widget>
-    <widget class="QComboBox" name="psolver_box">
-     <property name="geometry">
-      <rect>
-       <x>11</x>
-       <y>57</y>
-       <width>119</width>
-       <height>20</height>
-      </rect>
-     </property>
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>18</height>
-      </size>
-     </property>
-     <property name="acceptDrops">
-      <bool>true</bool>
-     </property>
-     <property name="frame">
-      <bool>true</bool>
-     </property>
-     <item>
-      <property name="text">
-       <string>-</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>poisfft</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>multigrid_noopt</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>multigrid</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>sor</string>
-      </property>
-     </item>
-    </widget>
-    <widget class="QLabel" name="fft_method_label">
-     <property name="geometry">
-      <rect>
-       <x>12</x>
-       <y>80</y>
-       <width>131</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>Specify FFT-method:</string>
-     </property>
-    </widget>
-    <widget class="QComboBox" name="fft_method_box">
-     <property name="geometry">
-      <rect>
-       <x>11</x>
-       <y>99</y>
-       <width>119</width>
-       <height>20</height>
-      </rect>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>18</height>
-      </size>
-     </property>
-     <item>
-      <property name="text">
-       <string>-</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>FFTW</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Temperton</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Singleton</string>
-      </property>
-     </item>
-    </widget>
-   </widget>
-   <widget class="QFrame" name="frame_4">
-    <property name="geometry">
-     <rect>
-      <x>170</x>
-      <y>200</y>
-      <width>181</width>
-      <height>131</height>
-     </rect>
-    </property>
-    <property name="frameShape">
-     <enum>QFrame::StyledPanel</enum>
-    </property>
-    <property name="frameShadow">
-     <enum>QFrame::Raised</enum>
-    </property>
-    <widget class="QLabel" name="label_16">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>10</y>
-       <width>91</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="font">
-      <font>
-       <weight>75</weight>
-       <bold>true</bold>
-      </font>
-     </property>
-     <property name="text">
-      <string>Misc</string>
-     </property>
-    </widget>
-    <widget class="QCheckBox" name="Oos_checkbox">
-     <property name="geometry">
-      <rect>
-       <x>10</x>
-       <y>30</y>
-       <width>161</width>
-       <height>21</height>
-      </rect>
-     </property>
-     <property name="toolTip">
-      <string>Hallo, ich bin ein Test-toolTip. Hier kÃ¶nnte eine tolle erklÃ€rung zu dieser SchaltflÃ€che stehen.</string>
-     </property>
-     <property name="text">
-      <string>Output of spectra</string>
-     </property>
-    </widget>
-    <widget class="QLineEdit" name="filename_line">
-     <property name="geometry">
-      <rect>
-       <x>24</x>
-       <y>104</y>
-       <width>100</width>
-       <height>23</height>
-      </rect>
-     </property>
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>23</height>
-      </size>
-     </property>
-     <property name="maximumSize">
-      <size>
-       <width>100</width>
-       <height>23</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>FILENAME.db</string>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="save_button">
-     <property name="geometry">
-      <rect>
-       <x>125</x>
-       <y>104</y>
-       <width>45</width>
-       <height>23</height>
-      </rect>
-     </property>
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>23</height>
-      </size>
-     </property>
-     <property name="maximumSize">
-      <size>
-       <width>45</width>
-       <height>16777215</height>
-      </size>
-     </property>
-     <property name="text">
-      <string>Save</string>
-     </property>
-    </widget>
-   </widget>
-   <widget class="QWidget" name="verticalLayoutWidget_8">
-    <property name="geometry">
-     <rect>
-      <x>380</x>
-      <y>240</y>
-      <width>197</width>
-      <height>31</height>
-     </rect>
-    </property>
-    <layout class="QVBoxLayout" name="verticalLayout_8">
-     <item>
-      <widget class="QLabel" name="result_label">
-       <property name="text">
-        <string>placeholder, should never be seen</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </widget>
-   <widget class="QLabel" name="result_headline">
-    <property name="geometry">
-     <rect>
-      <x>370</x>
-      <y>218</y>
-      <width>179</width>
-      <height>20</height>
+      <y>10</y>
+      <width>171</width>
+      <height>16</height>
      </rect>
     </property>
@@ -972,18 +165,502 @@
      </font>
     </property>
-    <property name="toolTip">
-     <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;tolerance for npex / npey&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-    </property>
-    <property name="text">
-     <string>Results</string>
-    </property>
-   </widget>
-   <widget class="Line" name="line_res_down">
-    <property name="geometry">
-     <rect>
-      <x>360</x>
-      <y>300</y>
-      <width>201</width>
+    <property name="text">
+     <string>   Define numerical grid</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="grid_min_label">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>82</y>
+      <width>71</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Minimum</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="grid_max_label">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>128</y>
+      <width>71</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Maximum</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="grid_nx_label">
+    <property name="geometry">
+     <rect>
+      <x>110</x>
+      <y>53</y>
+      <width>47</width>
+      <height>13</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>nx</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="grid_ny_label">
+    <property name="geometry">
+     <rect>
+      <x>240</x>
+      <y>53</y>
+      <width>47</width>
+      <height>13</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>ny</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="grid_nz_label">
+    <property name="geometry">
+     <rect>
+      <x>370</x>
+      <y>53</y>
+      <width>47</width>
+      <height>13</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>nz</string>
+    </property>
+   </widget>
+   <widget class="QWidget" name="verticalLayoutWidget">
+    <property name="geometry">
+     <rect>
+      <x>569</x>
+      <y>59</y>
+      <width>131</width>
+      <height>111</height>
+     </rect>
+    </property>
+    <layout class="QVBoxLayout" name="proc_layout_1">
+     <property name="spacing">
+      <number>5</number>
+     </property>
+     <item>
+      <widget class="QSpinBox" name="proc_min_box">
+       <property name="minimumSize">
+        <size>
+         <width>110</width>
+         <height>24</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>100</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="minimum">
+        <number>0</number>
+       </property>
+       <property name="maximum">
+        <number>99999999</number>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QSpinBox" name="proc_max_box">
+       <property name="minimumSize">
+        <size>
+         <width>110</width>
+         <height>24</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>100</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="minimum">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <number>99999999</number>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+   <widget class="QLabel" name="proc_header_label">
+    <property name="geometry">
+     <rect>
+      <x>500</x>
+      <y>10</y>
+      <width>191</width>
+      <height>16</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <weight>75</weight>
+      <bold>true</bold>
+     </font>
+    </property>
+    <property name="text">
+     <string>Define processor topology</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="proc_min_label">
+    <property name="geometry">
+     <rect>
+      <x>490</x>
+      <y>80</y>
+      <width>71</width>
       <height>20</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Minimum</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="proc_max_label">
+    <property name="geometry">
+     <rect>
+      <x>490</x>
+      <y>130</y>
+      <width>71</width>
+      <height>20</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Maximum</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="proc_nr_label">
+    <property name="geometry">
+     <rect>
+      <x>570</x>
+      <y>50</y>
+      <width>161</width>
+      <height>16</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Number of Processors</string>
+    </property>
+   </widget>
+   <widget class="Line" name="line">
+    <property name="geometry">
+     <rect>
+      <x>460</x>
+      <y>72</y>
+      <width>21</width>
+      <height>261</height>
+     </rect>
+    </property>
+    <property name="orientation">
+     <enum>Qt::Vertical</enum>
+    </property>
+   </widget>
+   <widget class="QLabel" name="psolver_header_label">
+    <property name="geometry">
+     <rect>
+      <x>9</x>
+      <y>223</y>
+      <width>141</width>
+      <height>16</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <weight>75</weight>
+      <bold>true</bold>
+     </font>
+    </property>
+    <property name="text">
+     <string>Pressure Solver</string>
+    </property>
+   </widget>
+   <widget class="QWidget" name="horizontalLayoutWidget">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>276</y>
+      <width>299</width>
+      <height>51</height>
+     </rect>
+    </property>
+    <layout class="QHBoxLayout" name="psolver_layout">
+     <property name="spacing">
+      <number>50</number>
+     </property>
+     <item>
+      <widget class="QComboBox" name="psolver_combo_box">
+       <item>
+        <property name="text">
+         <string>-</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>poisfft</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>multigrid_noopt</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>multigrid</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>sor</string>
+        </property>
+       </item>
+      </widget>
+     </item>
+     <item>
+      <widget class="QComboBox" name="fft_combo_box">
+       <property name="enabled">
+        <bool>false</bool>
+       </property>
+       <item>
+        <property name="text">
+         <string>-</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>FFTW</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>Temperton</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>Singleton</string>
+        </property>
+       </item>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+   <widget class="QLabel" name="psolver_method_label">
+    <property name="geometry">
+     <rect>
+      <x>9</x>
+      <y>263</y>
+      <width>141</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="layoutDirection">
+     <enum>Qt::LeftToRight</enum>
+    </property>
+    <property name="text">
+     <string>Method (psolver)</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignCenter</set>
+    </property>
+   </widget>
+   <widget class="QLabel" name="psolver_fft_label">
+    <property name="geometry">
+     <rect>
+      <x>190</x>
+      <y>263</y>
+      <width>161</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Specify FFT-Method</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignCenter</set>
+    </property>
+   </widget>
+   <widget class="QWidget" name="gridLayoutWidget_2">
+    <property name="geometry">
+     <rect>
+      <x>500</x>
+      <y>169</y>
+      <width>292</width>
+      <height>131</height>
+     </rect>
+    </property>
+    <layout class="QGridLayout" name="proc_layout_2">
+     <item row="1" column="0">
+      <widget class="QCheckBox" name="npex_npey_ratio_check">
+       <property name="text">
+        <string>Set fixed ratio (npex/npey)</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="0">
+      <widget class="QCheckBox" name="strict_matching_check">
+       <property name="layoutDirection">
+        <enum>Qt::LeftToRight</enum>
+       </property>
+       <property name="text">
+        <string>Strict Matching</string>
+       </property>
+       <property name="tristate">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QSpinBox" name="strict_matching_box">
+       <property name="enabled">
+        <bool>false</bool>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>44</width>
+         <height>24</height>
+        </size>
+       </property>
+       <property name="maximum">
+        <number>999</number>
+       </property>
+       <property name="value">
+        <number>24</number>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1">
+      <widget class="QSpinBox" name="npex_npey_deviation_box">
+       <property name="enabled">
+        <bool>false</bool>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>24</height>
+        </size>
+       </property>
+       <property name="minimum">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <number>3</number>
+       </property>
+       <property name="value">
+        <number>1</number>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="0">
+      <widget class="QSlider" name="npex_npey_deviation_slider">
+       <property name="enabled">
+        <bool>false</bool>
+       </property>
+       <property name="minimum">
+        <number>1</number>
+       </property>
+       <property name="maximum">
+        <number>3</number>
+       </property>
+       <property name="value">
+        <number>1</number>
+       </property>
+       <property name="sliderPosition">
+        <number>1</number>
+       </property>
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="QDoubleSpinBox" name="npex_npey_ratio_box">
+       <property name="enabled">
+        <bool>false</bool>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>24</height>
+        </size>
+       </property>
+       <property name="minimum">
+        <double>1.000000000000000</double>
+       </property>
+       <property name="maximum">
+        <double>100.000000000000000</double>
+       </property>
+       <property name="value">
+        <double>1.000000000000000</double>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+   <widget class="QWidget" name="horizontalLayoutWidget_2">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>170</y>
+      <width>234</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <layout class="QHBoxLayout" name="grid_layout_2">
+     <property name="spacing">
+      <number>0</number>
+     </property>
+     <item>
+      <widget class="QCheckBox" name="nx_ny_ratio_check">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>24</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>Set fixed ratio (nx/ny)</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QDoubleSpinBox" name="nx_ny_ratio_box">
+       <property name="enabled">
+        <bool>false</bool>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>24</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>60</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="value">
+        <double>1.000000000000000</double>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+   <widget class="Line" name="line_2">
+    <property name="geometry">
+     <rect>
+      <x>480</x>
+      <y>292</y>
+      <width>241</width>
+      <height>16</height>
      </rect>
     </property>
@@ -992,144 +669,107 @@
     </property>
    </widget>
-   <widget class="QPushButton" name="view_result_button">
-    <property name="geometry">
-     <rect>
-      <x>490</x>
-      <y>281</y>
-      <width>75</width>
-      <height>23</height>
-     </rect>
-    </property>
-    <property name="sizePolicy">
-     <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-      <horstretch>0</horstretch>
-      <verstretch>0</verstretch>
-     </sizepolicy>
-    </property>
-    <property name="text">
-     <string>View results</string>
-    </property>
-   </widget>
-   <widget class="QLabel" name="load_text_label">
-    <property name="geometry">
-     <rect>
-      <x>379</x>
-      <y>281</y>
-      <width>42</width>
-      <height>23</height>
-     </rect>
-    </property>
-    <property name="sizePolicy">
-     <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
-      <horstretch>0</horstretch>
-      <verstretch>0</verstretch>
-     </sizepolicy>
-    </property>
-    <property name="minimumSize">
-     <size>
-      <width>0</width>
-      <height>23</height>
-     </size>
-    </property>
-    <property name="toolTip">
-     <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of results you want to load in this Ui.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-    </property>
-    <property name="text">
-     <string>  Load</string>
-    </property>
-   </widget>
-   <widget class="QSpinBox" name="nor_spinbox">
-    <property name="enabled">
-     <bool>false</bool>
-    </property>
-    <property name="geometry">
-     <rect>
-      <x>420</x>
-      <y>281</y>
-      <width>61</width>
-      <height>23</height>
-     </rect>
-    </property>
-    <property name="sizePolicy">
-     <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-      <horstretch>0</horstretch>
-      <verstretch>0</verstretch>
-     </sizepolicy>
-    </property>
-    <property name="minimumSize">
-     <size>
-      <width>0</width>
-      <height>23</height>
-     </size>
-    </property>
-    <property name="maximum">
-     <number>9999</number>
-    </property>
-   </widget>
-   <widget class="QPushButton" name="startbutton">
-    <property name="geometry">
-     <rect>
-      <x>490</x>
-      <y>324</y>
-      <width>75</width>
-      <height>23</height>
-     </rect>
-    </property>
-    <property name="minimumSize">
-     <size>
-      <width>0</width>
-      <height>23</height>
-     </size>
-    </property>
-    <property name="maximumSize">
-     <size>
-      <width>16777215</width>
-      <height>23</height>
-     </size>
-    </property>
-    <property name="toolTip">
-     <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Starts calculation with the given parameters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+   <widget class="QCheckBox" name="spectra_box">
+    <property name="geometry">
+     <rect>
+      <x>500</x>
+      <y>309</y>
+      <width>151</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Output of Spectra</string>
+    </property>
+   </widget>
+   <widget class="Line" name="line_3">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>331</y>
+      <width>701</width>
+      <height>20</height>
+     </rect>
+    </property>
+    <property name="orientation">
+     <enum>Qt::Horizontal</enum>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="start_button">
+    <property name="geometry">
+     <rect>
+      <x>640</x>
+      <y>420</y>
+      <width>80</width>
+      <height>31</height>
+     </rect>
     </property>
     <property name="text">
      <string>Start</string>
     </property>
-    <property name="iconSize">
-     <size>
-      <width>18</width>
-      <height>18</height>
-     </size>
-    </property>
-   </widget>
-   <widget class="QPushButton" name="quitbutton">
-    <property name="geometry">
-     <rect>
-      <x>415</x>
-      <y>324</y>
-      <width>75</width>
-      <height>23</height>
-     </rect>
-    </property>
-    <property name="minimumSize">
-     <size>
-      <width>0</width>
-      <height>23</height>
-     </size>
+   </widget>
+   <widget class="QLabel" name="results_header_label">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>350</y>
+      <width>91</width>
+      <height>16</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <weight>75</weight>
+      <bold>true</bold>
+     </font>
+    </property>
+    <property name="text">
+     <string>Results</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="results_information_label">
+    <property name="geometry">
+     <rect>
+      <x>21</x>
+      <y>419</y>
+      <width>321</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Welcome to the Gridfinder.</string>
+    </property>
+   </widget>
+   <widget class="Line" name="line_4">
+    <property name="geometry">
+     <rect>
+      <x>460</x>
+      <y>346</y>
+      <width>20</width>
+      <height>111</height>
+     </rect>
+    </property>
+    <property name="orientation">
+     <enum>Qt::Vertical</enum>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="quit_button">
+    <property name="geometry">
+     <rect>
+      <x>510</x>
+      <y>420</y>
+      <width>50</width>
+      <height>31</height>
+     </rect>
     </property>
     <property name="text">
      <string>Quit</string>
     </property>
-    <property name="iconSize">
-     <size>
-      <width>18</width>
-      <height>18</height>
-     </size>
-    </property>
-   </widget>
-   <widget class="QProgressBar" name="testbar">
-    <property name="geometry">
-     <rect>
-      <x>364</x>
-      <y>239</y>
-      <width>206</width>
+   </widget>
+   <widget class="QProgressBar" name="progressbar">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>380</y>
+      <width>441</width>
       <height>23</height>
      </rect>
@@ -1138,16 +778,32 @@
      <number>0</number>
     </property>
-   </widget>
-   <widget class="QPushButton" name="question_box">
-    <property name="geometry">
-     <rect>
-      <x>395</x>
-      <y>324</y>
-      <width>21</width>
-      <height>23</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string>?</string>
+    <property name="textVisible">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="reset_button">
+    <property name="geometry">
+     <rect>
+      <x>560</x>
+      <y>420</y>
+      <width>80</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Reset</string>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="view_button">
+    <property name="geometry">
+     <rect>
+      <x>350</x>
+      <y>420</y>
+      <width>100</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>View Data</string>
     </property>
    </widget>
@@ -1158,28 +814,10 @@
      <x>0</x>
      <y>0</y>
-     <width>584</width>
-     <height>20</height>
+     <width>797</width>
+     <height>22</height>
     </rect>
    </property>
-   <widget class="QMenu" name="menuGridfinder">
-    <property name="title">
-     <string>Gridfinder</string>
-    </property>
-    <addaction name="actionSetting"/>
-    <addaction name="actionSchlie_en"/>
-   </widget>
-   <addaction name="menuGridfinder"/>
   </widget>
   <widget class="QStatusBar" name="statusbar"/>
-  <action name="actionSchlie_en">
-   <property name="text">
-    <string>SchlieÃen</string>
-   </property>
-  </action>
-  <action name="actionSetting">
-   <property name="text">
-    <string>Settings</string>
-   </property>
-  </action>
  </widget>
  <tabstops>
@@ -1190,23 +828,56 @@
   <tabstop>nz_min_box</tabstop>
   <tabstop>nz_max_box</tabstop>
-  <tabstop>np_min_box</tabstop>
-  <tabstop>np_max_box</tabstop>
-  <tabstop>tpn_box</tabstop>
-  <tabstop>d_box</tabstop>
-  <tabstop>dnxny_box</tabstop>
-  <tabstop>psolver_box</tabstop>
-  <tabstop>fft_method_box</tabstop>
-  <tabstop>startbutton</tabstop>
-  <tabstop>nor_spinbox</tabstop>
-  <tabstop>view_result_button</tabstop>
-  <tabstop>save_button</tabstop>
-  <tabstop>quitbutton</tabstop>
-  <tabstop>filename_line</tabstop>
-  <tabstop>Oos_checkbox</tabstop>
+  <tabstop>proc_min_box</tabstop>
+  <tabstop>proc_max_box</tabstop>
+  <tabstop>psolver_combo_box</tabstop>
+  <tabstop>fft_combo_box</tabstop>
+  <tabstop>nx_ny_ratio_check</tabstop>
+  <tabstop>nx_ny_ratio_box</tabstop>
+  <tabstop>strict_matching_check</tabstop>
+  <tabstop>strict_matching_box</tabstop>
+  <tabstop>npex_npey_ratio_check</tabstop>
+  <tabstop>npex_npey_ratio_box</tabstop>
+  <tabstop>npex_npey_deviation_slider</tabstop>
+  <tabstop>npex_npey_deviation_box</tabstop>
+  <tabstop>spectra_box</tabstop>
+  <tabstop>start_button</tabstop>
+  <tabstop>quit_button</tabstop>
  </tabstops>
  <resources/>
  <connections>
   <connection>
-   <sender>quitbutton</sender>
+   <sender>npex_npey_deviation_slider</sender>
+   <signal>valueChanged(int)</signal>
+   <receiver>npex_npey_deviation_box</receiver>
+   <slot>setValue(int)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>580</x>
+     <y>295</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>693</x>
+     <y>295</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>npex_npey_deviation_box</sender>
+   <signal>valueChanged(int)</signal>
+   <receiver>npex_npey_deviation_slider</receiver>
+   <slot>setValue(int)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>693</x>
+     <y>295</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>580</x>
+     <y>295</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>quit_button</sender>
    <signal>clicked()</signal>
    <receiver>MainWindow</receiver>
@@ -1214,106 +885,10 @@
    <hints>
     <hint type="sourcelabel">
-     <x>448</x>
-     <y>335</y>
+     <x>534</x>
+     <y>456</y>
     </hint>
     <hint type="destinationlabel">
-     <x>291</x>
-     <y>187</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>strict_box</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>tpn_box</receiver>
-   <slot>setVisible(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>422</x>
-     <y>193</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>514</x>
-     <y>193</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>npex_npey_box</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>d_box</receiver>
-   <slot>setVisible(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>422</x>
-     <y>193</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>513</x>
-     <y>193</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>tolerance_bar</sender>
-   <signal>valueChanged(int)</signal>
-   <receiver>tolerance_value</receiver>
-   <slot>setValue(int)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>430</x>
-     <y>221</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>521</x>
-     <y>220</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>npex_npey_box</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>tolerance_bar</receiver>
-   <slot>setVisible(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>422</x>
-     <y>193</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>430</x>
-     <y>221</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>npex_npey_box</sender>
-   <signal>clicked(bool)</signal>
-   <receiver>tolerance_value</receiver>
-   <slot>setVisible(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>422</x>
-     <y>193</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>521</x>
-     <y>220</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>tolerance_value</sender>
-   <signal>valueChanged(int)</signal>
-   <receiver>tolerance_bar</receiver>
-   <slot>setValue(int)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>521</x>
-     <y>220</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>430</x>
-     <y>221</y>
+     <x>370</x>
+     <y>249</y>
     </hint>
    </hints>
Index: palm/trunk/SCRIPTS/palm_gf_files/palm_gf_conf.py
===================================================================
--- palm/trunk/SCRIPTS/palm_gf_files/palm_gf_conf.py	(revision 4843)
+++ palm/trunk/SCRIPTS/palm_gf_files/palm_gf_conf.py	(revision 4869)
@@ -1,290 +1,60 @@
-def write_config(np_min, np_max, nx_min, nx_max, ny_min, ny_max, nz_min, nz_max, tpn, dnpexnpey, dnpexnpey_tolerance, dnxny, poisfft, switch,
-                 temperton, mlt_grid, spectr, rslt_thrs, ld_thrs):
-    #from configparser import ConfigParser  # windows
-    from ConfigParser import ConfigParser  # Linux
+#!/usr/bin/env python
+# windows
+from configparser import ConfigParser
+# linux
+#from configparser import configparser
+import os
 
-    # if __name__ == "__main__":
-    cfg = ConfigParser()
-
-    import os.path
-    if os.path.exists('.palm_gf_conf') is False:
-        cfg.add_section("processor_topology")
-        cfg.add_section("numerical_grid")
-        cfg.add_section("method")
-
-    #cfg.add_section("processor_topology")
-    cfg.set("processor_topology", "np_min", np_min)
-    cfg.set("processor_topology", "np_max", np_max)
-    cfg.set("processor_topology", "tasks_per_node", tpn)
-    cfg.set("processor_topology", "dnpexnpey", dnpexnpey)
-    cfg.set("processor_topology", "dnpexnpey_tolerance", dnpexnpey_tolerance)
-    cfg.set("processor_topology", "dnxny", dnxny)
-
-    #cfgadd_section("numerical_grid").
-    cfg.set("numerical_grid", "nx_min", nx_min)
-    cfg.set("numerical_grid", "nx_max", nx_max)
-    cfg.set("numerical_grid", "ny_min", ny_min)
-    cfg.set("numerical_grid", "ny_max", ny_max)
-    cfg.set("numerical_grid", "nz_min", nz_min)
-    cfg.set("numerical_grid", "nz_max", nz_max)
-
-    #cfg.add_section("method")
-    cfg.set("method", "poisfft", poisfft)
-    cfg.set("method", "switch", switch)
-    cfg.set("method", "temperton", temperton)
-    cfg.set("method", "mlt_grid", mlt_grid)
-    cfg.set("method", "spectr", spectr)
-
-    #cfg.add_section("settings")
-    #cfg.set("settings", "path", path)
-    #cfg.set("settings", "result_threshold", rslt_thrs)
-    #cfg.set("settings", "load_threshold", ld_thrs)
+cfg = ConfigParser()
 
 
-    with open(".palm_gf_config", "a") as configfile:
-        cfg.write(configfile)
+def cfg_write(nx_min, nx_max, ny_min, ny_max, nz_min, nz_max, np_min, np_max, tpn,
+              poisfft, switch, temperton, mlt_grid, spectr, dnxny, dpxpy, dpxpy_dev):
+    # receives parameters from palm_gf and creates/updates .ini file
+    if os.path.exists('./palm_gf_config.ini') is False:
+        cfg.add_section("Numerical Grid")
+        cfg.add_section("Processor Topology")
+        cfg.add_section("Method")
+    else:
+        cfg.read("palm_gf_config.ini")
+
+    cfg.set("Numerical Grid", "nx min", str(nx_min))
+    cfg.set("Numerical Grid", "nx max", str(nx_max))
+    cfg.set("Numerical Grid", "ny min", str(ny_min))
+    cfg.set("Numerical Grid", "ny max", str(ny_max))
+    cfg.set("Numerical Grid", "nz min", str(nz_min))
+    cfg.set("Numerical Grid", "nz max", str(nz_max))
+
+    cfg.set("Processor Topology", "np min", str(np_min))
+    cfg.set("Processor Topology", "np max", str(np_max))
+    cfg.set("Processor Topology", "tasks per node", str(tpn))
+    cfg.set("Processor Topology", "ratio nx/ny", str(dnxny))
+    cfg.set("Processor Topology", "ratio npex/npey", str(dpxpy))
+    cfg.set("Processor Topology", "ratio npex/npey tolerance", str(dpxpy_dev))
+
+    cfg.set("Method", "poisfft", str(poisfft))
+    cfg.set("Method", "switch", str(switch))
+    cfg.set("Method", "temperton", str(temperton))
+    cfg.set("Method", "multigrid", str(mlt_grid))
+    cfg.set("Method", "spectra", str(spectr))
+
+    with open("./palm_gf_config.ini", 'w') as cfgfile:
+        cfg.write(cfgfile)
+
+    return True
 
 
-def read_config():
-    #from configparser import ConfigParser  # windows
-    from ConfigParser import ConfigParser  # Linux
+def cfg_read():
+    # reads the .ini File and returns all parameters in a list
+    cfg.read("palm_gf_config.ini")
+    return_list = [cfg.get("Numerical Grid", "nx min"), cfg.get("Numerical Grid", "nx max"),
+                   cfg.get("Numerical Grid", "ny min"), cfg.get("Numerical Grid", "ny max"),
+                   cfg.get("Numerical Grid", "nz min"), cfg.get("Numerical Grid", "nz max"),
+                   cfg.get("Processor Topology", "np min"), cfg.get("Processor Topology", "np max"),
+                   cfg.get("Processor Topology", "tasks per node"), cfg.get("Processor Topology", "ratio nx/ny"),
+                   cfg.get("Processor Topology", "ratio npex/npey"),
+                   cfg.get("Processor Topology", "ratio npex/npey tolerance"), cfg.get("Method", "poisfft"),
+                   cfg.get("Method", "switch"), cfg.get("Method", "temperton"), cfg.get("Method", "multigrid"),
+                   cfg.get("Method", "spectra")]
 
-
-    cfg = ConfigParser()
-
-    cfg.read(".palm_gf_config")
-    np_min = cfg.get("processor_topology", "np_min")
-    np_max = cfg.get("processor_topology", "np_max")
-    tpn = cfg.get("processor_topology", "tasks_per_node")
-    dnpexnpey = cfg.get("processor_topology", "dnpexnpey")
-    dnpexnpey_tolerance = cfg.get("processor_topology", "dnpexnpey_tolerance")
-    dnxny = cfg.get("processor_topology", "dnxny")
-
-    nx_min = cfg.get("numerical_grid", "nx_min")
-    nx_max = cfg.get("numerical_grid", "nx_max")
-    ny_min = cfg.get("numerical_grid", "ny_min")
-    ny_max = cfg.get("numerical_grid", "ny_max")
-    nz_min = cfg.get("numerical_grid", "nz_min")
-    nz_max = cfg.get("numerical_grid", "nz_max")
-
-    poisfft = cfg.get("method", "poisfft")
-    switch = cfg.get("method", "switch")
-    temperton = cfg.get("method", "temperton")
-    mlt_grid = cfg.get("method", "mlt_grid")
-    spectr = cfg.get("method", "spectr")
-
-    import ConfigParser as conf
-    try:
-        result_threshold = cfg.get("settings", "result_threshold")
-        load_threshold = cfg.get("settings", "load_threshold")
-        path = cfg.get("settings", 'path')
-
-    except conf.NoSectionError:
-
-        path = '/localdata/'
-        result_threshold = 250000
-        load_threshold = 100000
-
-    return np_min, np_max, tpn, dnpexnpey, dnpexnpey_tolerance, dnxny, nx_min, nx_max, ny_min, ny_max, nz_min, nz_max, poisfft, switch, temperton, mlt_grid, spectr, result_threshold, load_threshold, path
-
-
-def write_config_settings(path, rslt_thrs, ld_thrs):
-
-    from ConfigParser import ConfigParser
-
-    cfg = ConfigParser()
-
-    cfg.add_section('settings')
-
-    cfg.set('settings', 'path', path)
-    cfg.set('settings', "result_threshold", rslt_thrs)
-    cfg.set('settings', "load_threshold", ld_thrs)
-
-    with open(".palm_gf_config", "a") as configfile:
-        cfg.write(configfile)
-
-
-def read_config_settings():
-
-    from ConfigParser import ConfigParser
-    import ConfigParser as con
-
-    cfg = ConfigParser()
-    cfg.read(".palm_gf_config")
-
-    try:
-        path = cfg.get("settings", "path")
-        result_thrs = cfg.get("settings", "result_threshold")
-        load_thrs = cfg.get("settings", "load_threshold")
-
-    except con.NoSectionError:
-
-        path = '/localdata/'
-        result_thrs = 250000
-        load_thrs = 100000
-
-    except con.NoOptionError:
-
-        path = '/localdata/'
-        result_thrs = 250000
-        load_thrs = 100000
-
-    #print path, result_thrs, load_thrs
-
-    return path, result_thrs, load_thrs
-
-
-# ***********************************************
-
-
-def closing_cleanup():
-    from ConfigParser import ConfigParser  # Linux
-    import ConfigParser as conf
-    import os, shutil, time
-
-    cfg = ConfigParser()
-
-    try:
-
-        cfg.read(".palm_gf_config")
-        np_min = cfg.get("processor_topology", "np_min")
-        np_max = cfg.get("processor_topology", "np_max")
-        tpn = cfg.get("processor_topology", "tasks_per_node")
-        dnpexnpey = cfg.get("processor_topology", "dnpexnpey")
-        dnpexnpey_tolerance = cfg.get("processor_topology", "dnpexnpey_tolerance")
-        dnxny = cfg.get("processor_topology", "dnxny")
-
-        nx_min = cfg.get("numerical_grid", "nx_min")
-        nx_max = cfg.get("numerical_grid", "nx_max")
-        ny_min = cfg.get("numerical_grid", "ny_min")
-        ny_max = cfg.get("numerical_grid", "ny_max")
-        nz_min = cfg.get("numerical_grid", "nz_min")
-        nz_max = cfg.get("numerical_grid", "nz_max")
-
-        poisfft = cfg.get("method", "poisfft")
-        switch = cfg.get("method", "switch")
-        temperton = cfg.get("method", "temperton")
-        mlt_grid = cfg.get("method", "mlt_grid")
-        spectr = cfg.get("method", "spectr")
-
-        var1_bool = True
-
-    except conf.NoSectionError:
-        np_min = 0
-        np_max = 0
-        tpn = 0
-        dnpexnpey = 0
-        dnpexnpey_tolerance = 0
-        dnxny = 0
-
-        nx_min = 0
-        nx_max = 0
-        ny_min = 0
-        ny_max = 0
-        nz_min = 0
-        nz_max = 0
-
-        poisfft = False
-        switch = False
-        temperton = False
-        mlt_grid = False
-        spectr = False
-        var1_bool = False
-
-    with open(".palm_gf_config", "w") as configfile:
-        cfg.write(configfile)
-
-    try:
-        cfg.read(".palm_gf_config")
-        rslt_thrs = cfg.get("settings", "result_threshold")
-        ld_thrs = cfg.get("settings", "load_threshold")
-        path = cfg.get("settings", 'path')
-
-        var2_bool = True
-
-    except conf.NoSectionError:
-
-        path = '/localdata/'
-        rslt_thrs = 250000
-        ld_thrs = 100000
-
-        var2_bool = False
-
-
-
-    with open(".palm_gf_config", "w") as configfile:
-        cfg.write(configfile)
-
-
-
-    #os.remove('.palm_gf_config')
-
-
-
-    try:
-        cfg.set("processor_topology", "np_min", np_min)
-        cfg.set("processor_topology", "np_max", np_max)
-        cfg.set("processor_topology", "tasks_per_node", tpn)
-        cfg.set("processor_topology", "dnpexnpey", dnpexnpey)
-        cfg.set("processor_topology", "dnpexnpey_tolerance", dnpexnpey_tolerance)
-        cfg.set("processor_topology", "dnxny", dnxny)
-
-
-        cfg.set("numerical_grid", "nx_min", nx_min)
-        cfg.set("numerical_grid", "nx_max", nx_max)
-        cfg.set("numerical_grid", "ny_min", ny_min)
-        cfg.set("numerical_grid", "ny_max", ny_max)
-        cfg.set("numerical_grid", "nz_min", nz_min)
-        cfg.set("numerical_grid", "nz_max", nz_max)
-
-
-        cfg.set("method", "poisfft", poisfft)
-        cfg.set("method", "switch", switch)
-        cfg.set("method", "temperton", temperton)
-        cfg.set("method", "mlt_grid", mlt_grid)
-        cfg.set("method", "spectr", spectr)
-
-    except conf.NoSectionError:
-        cfg.add_section("processor_topology")
-        cfg.set("processor_topology", "np_min", np_min)
-        cfg.set("processor_topology", "np_max", np_max)
-        cfg.set("processor_topology", "tasks_per_node", tpn)
-        cfg.set("processor_topology", "dnpexnpey", dnpexnpey)
-        cfg.set("processor_topology", "dnpexnpey_tolerance", dnpexnpey_tolerance)
-        cfg.set("processor_topology", "dnxny", dnxny)
-
-        cfg.add_section("numerical_grid")
-        cfg.set("numerical_grid", "nx_min", nx_min)
-        cfg.set("numerical_grid", "nx_max", nx_max)
-        cfg.set("numerical_grid", "ny_min", ny_min)
-        cfg.set("numerical_grid", "ny_max", ny_max)
-        cfg.set("numerical_grid", "nz_min", nz_min)
-        cfg.set("numerical_grid", "nz_max", nz_max)
-
-        cfg.add_section("method")
-        cfg.set("method", "poisfft", poisfft)
-        cfg.set("method", "switch", switch)
-        cfg.set("method", "temperton", temperton)
-        cfg.set("method", "mlt_grid", mlt_grid)
-        cfg.set("method", "spectr", spectr)
-
-
-    try:
-        cfg.set("settings", "path", path)
-        cfg.set("settings", "result_threshold", rslt_thrs)
-        cfg.set("settings", "load_threshold", ld_thrs)
-
-    except conf.NoSectionError:
-        cfg.add_section("settings")
-        cfg.set("settings", "path", path)
-        cfg.set("settings", "result_threshold", rslt_thrs)
-        cfg.set("settings", "load_threshold", ld_thrs)
-
-
-
-
-
-
-    with open(".palm_gf_config", "w") as configfile:
-        cfg.write(configfile)
-
+    return return_list
Index: palm/trunk/SCRIPTS/palm_gf_files/palm_gf_exec.py
===================================================================
--- palm/trunk/SCRIPTS/palm_gf_files/palm_gf_exec.py	(revision 4843)
+++ palm/trunk/SCRIPTS/palm_gf_files/palm_gf_exec.py	(revision 4869)
@@ -1,320 +1,274 @@
-def grid_executer():
-    import palm_gf_conf as config_wr
-    import sqlite3
-    conn = sqlite3.connect(".palm_gf_data.db")
-    c = conn.cursor()
-    c.execute("DROP TABLE IF EXISTS grid_current")
-    c.execute("DROP TABLE IF EXISTS grid_limits")
-    c.execute("CREATE TABLE IF NOT EXISTS grid_current(nx INT, ny INT, nz INT, npex INT, npey INT, npxnpy FLOAT, np INT, ngpts INT)")
-    c.execute("CREATE TABLE IF NOT EXISTS grid_limits(nx INT, ny INT, nz INT, npex INT, npey INT, npxnpy FLOAT, np INT, ngpts INT)")
-    conn.commit()
-    main_bool = True
-    parameters = config_wr.read_config()
-    print(parameters)
-    min_procs = int(parameters[0])
-    max_procs = int(parameters[1])
-    tpn = int(parameters[2])
-    dnpexnpey = float(parameters[3])
-    dnxny = float(parameters[4])
-    nx_min = int(parameters[5])
-    nx_max = int(parameters[6])
-    ny_min = int(parameters[7])
-    ny_max = int(parameters[8])
-    nz_min = int(parameters[9])
-    nz_max = int(parameters[10])
-    poisfft = parameters[11]
-    switch = parameters[12]
-    tempterton = parameters[13]
-    mlt_grid = parameters[14]
-    spectr = parameters[15]
-
-    if poisfft == str(True):
-        poisfft = True
-    else:
-        poisfft = False
-
-    if switch == str(True):
-        switch = True
-    else:
-        switch = False
-
-    if tempterton == str(True):
-        tempterton = True
-    else:
-        tempterton = False
-
-    if mlt_grid == str(True):
-        mlt_grid = True
-    else:
-        mlt_grid = False
-
-    if spectr == str(True):
-        spectr = True
-    else:
-        spectr = False
-
-    print(spectr, type(spectr))
-    print(poisfft, switch, tempterton, mlt_grid, spectr)
-
-    np_used = min_procs
-    counter = 0
-
-    nx = nx_min
-    ny = ny_min
-    nz = nz_min
-
-    from math import floor
-
-    def factors(n):
-        result = []
-        for i in range(2, n + 1):  # test all integers between 2 and n
-            s = 0
-            while n / i == floor(n / float(i)):  # is n/i an integer?
-                n = n / float(i)
-                s += 1
-            if s > 0:
-                for k in range(s):
-                    result.append(i)  # i is a pf s times
-                    if n == 1:
-                        return result
-
-    while np_used <= max_procs:
-        a = 1
-
-        while a <= np_used:
-            prcs_var = np_used % a
-            if prcs_var != 0:
-                a += 1
-            elif prcs_var == 0:
-                npex = a
-                npey = int(np_used / npex)
-
-                if tpn != 0:
-                    if np_used % tpn != 0:
-                        a += 1
-                        continue
-
-                if dnpexnpey != 0 and npex / npey != dnpexnpey:
+#!/usr/bin/env python
+from PyQt5.QtCore import pyqtSignal, QThread
+from math import floor
+from palm_gf_files.palm_gf_conf import cfg_read
+from datetime import datetime
+import sqlite3
+
+
+class MyThread(QThread):
+    change_value = pyqtSignal(int)
+    completed = pyqtSignal(int, int)
+    busy = pyqtSignal()
+
+    def run(self):
+        # has to be defined in QThread class
+        # starts calculation
+        self.mainroutine()
+
+    def mainroutine(self):
+        # determines all possible solutions for given parameters
+        start = datetime.now()
+        conn = sqlite3.connect("palm_gf_data.db")
+        c = conn.cursor()
+        c.execute("DROP TABLE IF EXISTS grid_current")
+        c.execute("DROP TABLE IF EXISTS grid_limits")
+        c.execute("CREATE TABLE IF NOT EXISTS grid_current(nx INT, ny INT, nz INT, npex INT, npey INT, pxpy FLOAT,"
+                  "np INT, ngpts FLOAT, nxnpex FLOAT, nynpey FLOAT)")
+        c.execute("CREATE TABLE IF NOT EXISTS grid_limits(nx INT, ny INT, nz INT, npex INT, npey INT, pxpy FLOAT,"
+                  "np INT, ngpts FLOAT, nxnpex FLOAT, nynpey FLOAT)")
+        conn.commit()
+        var = cfg_read()
+
+        for j in range(12, 17):
+            if var[j] == "True":
+                var[j] = True
+            else:
+                var[j] = False
+
+        nx_min = int(var[0])
+        nx_max = int(var[1])
+        ny_min = int(var[2])
+        ny_max = int(var[3])
+        nz_min = int(var[4])
+        nz_max = int(var[5])
+        procs_min = int(var[6])
+        procs_max = int(var[7])
+        tpn = int(var[8])
+        dnxny = float(var[9])
+        dpxpy = float(var[10])
+        dpxpy_dev = int(var[11])
+        poisfft = var[12]
+        switch = var[13]
+        temperton = var[14]
+        mlt_grid = var[15]
+        spectr = var[16]
+
+        np_used = procs_min
+        counter = 0
+        cnt = 0
+        nx = nx_min
+        ny = ny_min
+        nz = nz_min
+
+        def factors(n):
+            # prime factorization
+            result = []
+            for i in range(2, n + 1):
+                s = 0
+                while n / i == floor(n / float(i)):
+                    n = n / float(i)
+                    s += 1
+                if s > 0:
+                    for k in range(s):
+                        result.append(i)
+                        if n == 1:
+                            return result
+
+        def temperton_check(nx_, ny_):
+            # uses previously defined prime factorization and determines if ny+1/nx+1 is multiple of 2,3,5
+            nx_list = factors(nx_ + 1)
+            ny_list = factors(ny_ + 1)
+            return_value = 1
+            i = 0
+            if nx_list is not None:
+                while i < len(nx_list):
+                    if not (nx_list[i] == 2 or nx_list[i] == 3 or nx_list[i] == 5):
+                        return_value = 0
+                    i += 1
+                j = 0
+                if ny_list is not None:
+                    while j < len(ny_list):
+                        if not (ny_list[j] == 2 or ny_list[j] == 3 or ny_list[j] == 5):
+                            return_value = 0
+                        j += 1
+
+            if nx_list is None:
+                return_value = 0
+            if ny_list is None:
+                return_value = 0
+
+            return return_value
+            # * * *
+
+        while np_used <= procs_max:
+            a = 1
+            while a <= np_used:
+                if cnt != ((np_used - procs_min) / (procs_max - procs_min)) * 100:
+                    cnt = ((np_used - procs_min) / (procs_max - procs_min)) * 100
+                    self.change_value.emit(cnt)
+                procs_var = np_used % a
+                if procs_var != 0:
                     a += 1
-                    continue
-
-                while nx <= nx_max:
-                    if (nx + 1) % npex != 0:
+                elif procs_var == 0:
+                    npex = a
+                    npey = int(np_used / npex)
+
+                    if tpn != 0:
+                        if np_used % tpn != 0:
+                            a += 1
+                            continue
+
+                    if dpxpy != 0.:
+                        if (dpxpy - dpxpy_dev*dpxpy) > (float(npex)/float(npey)) or \
+                           (float(npex)/float(npey)) > (dpxpy + dpxpy_dev*dpxpy):
+                            a += 1
+                            continue
+
+                    # if dpxpy != 0. and float(npex) / float(npey) != dpxpy:
+                        # a += 1
+                        # continue
+
+                    while nx <= nx_max:
+                        if (nx + 1) % npex != 0:
+                            nx += 1
+                            continue
+
+                        if mlt_grid is True and nx % 2 != 0:
+                            nx += 1
+                            continue
+
+                        if switch is True and (nx + 1) % npey != 0:
+                            nx += 1
+                            continue
+
+                        if npex > nx:
+                            nx += 1
+                            continue
+
+                        while ny <= ny_max:
+
+                            if dnxny != 0. and float(nx) / float(ny) != float(dnxny):
+                                ny += 1
+                                continue
+
+                            if (ny + 1) % npey != 0:
+                                ny += 1
+                                continue
+
+                            if mlt_grid is True and ny % 2 != 0:
+                                ny += 1
+                                continue
+
+                            if switch is True and (ny + 1) % npex != 0:
+                                ny += 1
+                                continue
+
+                            if npey > ny:
+                                ny += 1
+                                continue
+
+                            while nz <= nz_max:
+
+                                if mlt_grid is True and nz % 2 != 0:
+                                    nz += 1
+                                    continue
+
+                                if poisfft is True and nz % npex != 0:
+                                    nz += 1
+                                    continue
+
+                                if spectr is True and nz % npey != 0:
+                                    nz += 1
+                                    continue
+
+                                if temperton is True and nx > 1 and ny > 1 and temperton_check(nx, ny) == 0:
+                                    nz += 1
+                                    continue
+
+                                npxnpy = format(float(npex) / float(npey), '.2f')
+                                nxnpex = float(nx + 1) / float(npex)
+                                nynpey = float(ny + 1) / float(npey)
+
+                                c.execute("""INSERT OR REPLACE INTO grid_current(nx, ny, nz, npex, npey, pxpy,
+                                np, ngpts, nxnpex, nynpey) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""",
+                                          (nx, ny, nz, npex, npey, npxnpy, (npex * npey), (nx * ny * nz),
+                                           nxnpex, nynpey))
+
+                                counter += 1
+                                nz += 1
+                            nz = nz_min
+                            ny += 1
+                        ny = ny_min
                         nx += 1
-                        continue
-
-                    if mlt_grid is True and (nx + 1) % 2 != 0:
-                        nx += 1
-                        continue
-
-                    if switch is True and (nx + 1) % npey != 0:
-                        nx += 1
-                        continue
-                    if npex > nx:
-                        nx += 1
-                        continue
-
-                    while ny <= ny_max:
-
-                        if dnxny != 0 and float(nx) / float(ny) != float(dnxny):
-                            ny += 1
-                            continue
-                        if (ny + 1) % npey != 0:
-                            ny += 1
-                            continue
-
-                        if mlt_grid is True and ny % 2 != 0:
-                            ny += 1
-                            continue
-
-                        if (ny + 1) % npex != 0 and switch is True:
-                            ny += 1
-                            continue
-                        if npey > ny:
-                            ny += 1
-                            continue
-
-                        while nz <= nz_max:
-
-                            if mlt_grid is True and nz % 2 != 0:
-                                nz += 1
-                                continue
-
-                            if poisfft is True and nz % npex != 0:
-                                nz += 1
-                                continue
-
-                            if spectr is True and nz % npey != 0:
-                                nz += 1
-                                continue
-
-                            if tempterton is True and nx > 1 and ny > 1:  # and nz < 1:
-
-                                nx_list = factors(nx + 1)
-                                i = 0
-                                nx_var = nx_list[i]
-
-                                while i < len(nx_list):
-                                    if nx_var != 2 or nx_var != 3 or nx_var != 5:
-
-                                        i += 1
-                                        continue
-
-                                    i += 1
-                                ny_list = factors(ny + 1)
-                                i = 0
-                                ny_var = ny_list[i]
-                                while i < len(ny_list):
-                                    if ny_var != 2 or ny_var != 3 or ny_var != 5:
-
-                                        i += 1
-                                        continue
-                                    i += 1
-
-                            counter += 1
-
-                            npxnpy = format(float(npex)/float(npey), '.2f')
-                            c.execute("""INSERT OR REPLACE INTO grid_current(nx, ny, nz, npex, npey, npxnpy, np, ngpts) VALUES (?, ?, ?, ?, ?, ?, ?, ?)""",
-                            (nx, ny, nz, npex, npey, npxnpy, (npex * npey), (nx*ny*nz)))
-
-                            nz += 11
-                        nz = nz_min
-                        ny += 1
-                    ny = ny_min
-                    nx += 1
-                nx = nx_min
-                a += 1
-                #  a += 1
-        np_used += 1
+                    nx = nx_min
+                    a += 1
+            np_used += 1
+            conn.commit()
 
         conn.commit()
-
-
-
-    conn.commit()
-    c.close()
-    conn.close()
-
-    #********************************
-
-    conn = sqlite3.connect(".palm_gf_data.db")
-    c = conn.cursor()
-    try:
-        c.execute("SELECT nx FROM grid_current ORDER BY nx DESC LIMIT 1")
-        mx_nx = c.fetchone()[0]
-        #print(mx_nx)
-        c.execute("SELECT nx FROM grid_current ORDER BY nx  LIMIT 1")
-        mn_nx = c.fetchone()[0]
-        #print(mn_nx)
-        c.execute("SELECT ny FROM grid_current ORDER BY ny DESC LIMIT 1")
-        mx_ny = c.fetchone()[0]
-        #print(mx_ny)
-        c.execute("SELECT ny FROM grid_current ORDER BY ny  LIMIT 1")
-        mn_ny = c.fetchone()[0]
-        #print(mn_ny)
-        c.execute("SELECT nz FROM grid_current ORDER BY nz DESC LIMIT 1")
-        mx_nz = c.fetchone()[0]
-        #print(mx_nz)
-        c.execute("SELECT nz FROM grid_current ORDER BY nz  LIMIT 1")
-        mn_nz = c.fetchone()[0]
-        #print(mn_nz)
-        c.execute("SELECT npex FROM grid_current ORDER BY npex DESC LIMIT 1")
-        mx_npex = c.fetchone()[0]
-        #print(mx_npex)
-        c.execute("SELECT npex FROM grid_current ORDER BY npex  LIMIT 1")
-        mn_npex = c.fetchone()[0]
-        #print(mn_npex)
-        c.execute("SELECT npey FROM grid_current ORDER BY npey DESC LIMIT 1")
-        mx_npey = c.fetchone()[0]
-        #print(mx_npey)
-        c.execute("SELECT npey FROM grid_current ORDER BY npey  LIMIT 1")
-        mn_npey = c.fetchone()[0]
-        #print(mn_npey)
-        c.execute("SELECT npxnpy FROM grid_current ORDER BY npxnpy DESC LIMIT 1")
-        mx_npxnpy = c.fetchone()[0]
-        #print(mx_npxnpy)
-        c.execute("SELECT npxnpy FROM grid_current ORDER BY npxnpy  LIMIT 1")
-        mn_npxnpy = c.fetchone()[0]
-        #print(mn_npxnpy)
-        c.execute("SELECT np FROM grid_current ORDER BY np DESC LIMIT 1")
-        mx_np = c.fetchone()[0]
-        #print(mx_np)
-        c.execute("SELECT np FROM grid_current ORDER BY np LIMIT 1")
-        mn_np = c.fetchone()[0]
-        #print(mn_np)
-        c.execute("SELECT ngpts FROM grid_current ORDER BY ngpts DESC LIMIT 1")
-        mx_ngpts = c.fetchone()[0]
-        #print(mx_ngpts)
-        c.execute("SELECT ngpts FROM grid_current ORDER BY ngpts LIMIT 1")
-        mn_ngpts = c.fetchone()[0]
-        #print(mn_ngpts)
-
-        conn.commit()
-        c.execute(
-            """INSERT OR REPLACE INTO grid_limits(nx, ny, nz, npex, npey, npxnpy, np, ngpts) VALUES (?, ?, ?, ?, ?, ?, ?, ?)""",
-            (mn_nx, mn_ny, mn_nz, mn_npex, mn_npey, mn_npxnpy, mn_np, mn_ngpts))
-        #conn.commit()
-        #print("test", mn_nx)
-        c.execute(
-            """INSERT OR REPLACE INTO grid_limits(nx, ny, nz, npex, npey, npxnpy, np, ngpts) VALUES (?, ?, ?, ?, ?, ?, ?, ?)""",
-            (mx_nx, mx_ny, mx_nz, mx_npex, mx_npey, mx_npxnpy, mx_np, mx_ngpts))
-        conn.commit()
-
-        c.close()
-        conn.close()
-    except TypeError:
-
-        checkfile = open(".palm_gf_tmp", "w")
-        if counter != 0:
-            checkfile.write("Gridfinder found " + str(counter) + " results.\n1")
-        else:
-            checkfile.write("Check input, no Results found.\n0")
-        checkfile.close()
-
-
-
-    checkfile = open(".palm_gf_tmp", "w")
-    if counter != 0:
-        checkfile.write("Gridfinder found " + str(counter) + " results.\n1")
-    else:
-        checkfile.write("Check input, no Results found.\n0")
-    checkfile.close()
-    return main_bool
-
-
-
-def grid_maxmin():
-
-    import palm_gf_conf
-    import sqlite3
-
-    conn = sqlite3.connect("grid_current.db")
-    c = conn.cursor()
-    c.execute("DROP TABLE IF EXISTS grid_maxmin")
-    c.execute("CREATE TABLE IF NOT EXISTS grid_maxmin(np_min INT,np_max INT, npex_min INT,npex_max INT, npey_min INT,npey_max INT, nx_min INT,nx_max INT,"
-              " ny_min INT,ny_max INT, nz_min INT, nz_max INT)")
-    parm = config_wr.read_config()
-    min_procs = int(parm[0])
-    max_procs = int(parameters[1])
-    tpn = int(parameters[2])
-    dnpexnpey = float(parameters[3])
-    dnxny = float(parameters[4])
-    nx_min = int(parameters[5])
-    nx_max = int(parameters[6])
-    ny_min = int(parameters[7])
-    ny_max = int(parameters[8])
-    nz_min = int(parameters[9])
-    nz_max = int(parameters[10])
-
-
-
-
-
-    c.execute(
-        """INSERT OR REPLACE INTO grid_maxmin(np_min, np_max, npex_min, npex_max, npey_min, npey_max, nx_min, nx_max,
-         ny_min, ny_max, nz_min, nz_max) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""",
-        (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))
-
-    conn.commit()
-    c.close()
-    conn.close()
+        self.busy.emit()
+        # read out limits of data in .db
+        try:
+            c.execute("SELECT nx FROM grid_current ORDER BY nx DESC LIMIT 1")
+            mx_nx = c.fetchone()[0]
+            c.execute("SELECT nx FROM grid_current ORDER BY nx  LIMIT 1")
+            mn_nx = c.fetchone()[0]
+            c.execute("SELECT ny FROM grid_current ORDER BY ny DESC LIMIT 1")
+            mx_ny = c.fetchone()[0]
+            c.execute("SELECT ny FROM grid_current ORDER BY ny  LIMIT 1")
+            mn_ny = c.fetchone()[0]
+            c.execute("SELECT nz FROM grid_current ORDER BY nz DESC LIMIT 1")
+            mx_nz = c.fetchone()[0]
+            c.execute("SELECT nz FROM grid_current ORDER BY nz  LIMIT 1")
+            mn_nz = c.fetchone()[0]
+            c.execute("SELECT npex FROM grid_current ORDER BY npex DESC LIMIT 1")
+            mx_npex = c.fetchone()[0]
+            c.execute("SELECT npex FROM grid_current ORDER BY npex  LIMIT 1")
+            mn_npex = c.fetchone()[0]
+            c.execute("SELECT npey FROM grid_current ORDER BY npey DESC LIMIT 1")
+            mx_npey = c.fetchone()[0]
+            c.execute("SELECT npey FROM grid_current ORDER BY npey  LIMIT 1")
+            mn_npey = c.fetchone()[0]
+            c.execute("SELECT pxpy FROM grid_current ORDER BY pxpy DESC LIMIT 1")
+            mx_npxnpy = c.fetchone()[0]
+            c.execute("SELECT pxpy FROM grid_current ORDER BY pxpy  LIMIT 1")
+            mn_npxnpy = c.fetchone()[0]
+            c.execute("SELECT np FROM grid_current ORDER BY np DESC LIMIT 1")
+            mx_np = c.fetchone()[0]
+            c.execute("SELECT np FROM grid_current ORDER BY np LIMIT 1")
+            mn_np = c.fetchone()[0]
+            c.execute("SELECT ngpts FROM grid_current ORDER BY ngpts DESC LIMIT 1")
+            mx_ngpts = c.fetchone()[0]
+            c.execute("SELECT ngpts FROM grid_current ORDER BY ngpts LIMIT 1")
+            mn_ngpts = c.fetchone()[0]
+            c.execute("SELECT nxnpex FROM grid_current ORDER BY nxnpex DESC LIMIT 1")
+            mx_nxpex = c.fetchone()[0]
+            c.execute("SELECT nxnpex FROM grid_current ORDER BY nxnpex LIMIT 1")
+            mn_nxpex = c.fetchone()[0]
+            c.execute("SELECT nynpey FROM grid_current ORDER BY nynpey DESC LIMIT 1")
+            mx_nypey = c.fetchone()[0]
+            c.execute("SELECT nynpey FROM grid_current ORDER BY nynpey LIMIT 1")
+            mn_nypey = c.fetchone()[0]
+
+            conn.commit()
+            c.execute(
+                """INSERT OR REPLACE INTO grid_limits(nx, ny, nz, npex, npey,
+                 pxpy, np, ngpts, nxnpex, nynpey) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""",
+                (mn_nx, mn_ny, mn_nz, mn_npex, mn_npey, mn_npxnpy, mn_np,  mn_ngpts, mn_nxpex, mn_nypey))
+
+            c.execute(
+                """INSERT OR REPLACE INTO grid_limits(nx, ny, nz, npex, npey,
+                 pxpy, np, ngpts, nxnpex, nynpey) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""",
+                (mx_nx, mx_ny, mx_nz, mx_npex, mx_npey, mx_npxnpy, mx_np, mx_ngpts, mx_nxpex, mx_nypey))
+            conn.commit()
+
+            c.close()
+            conn.close()
+        except TypeError:
+            pass
+
+        finish = datetime.now()
+        timedelta = finish - start
+        timer = (int(timedelta.seconds))
+        self.completed.emit(counter, timer)
Index: palm/trunk/SCRIPTS/palm_gf_files/palm_gf_settings.ui
===================================================================
--- palm/trunk/SCRIPTS/palm_gf_files/palm_gf_settings.ui	(revision 4843)
+++ 	(revision )
@@ -1,146 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Dialog</class>
- <widget class="QDialog" name="Dialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>560</width>
-    <height>145</height>
-   </rect>
-  </property>
-  <property name="contextMenuPolicy">
-   <enum>Qt::DefaultContextMenu</enum>
-  </property>
-  <property name="windowTitle">
-   <string>Settings</string>
-  </property>
-  <widget class="QDialogButtonBox" name="buttonBox">
-   <property name="geometry">
-    <rect>
-     <x>70</x>
-     <y>100</y>
-     <width>181</width>
-     <height>32</height>
-    </rect>
-   </property>
-   <property name="orientation">
-    <enum>Qt::Horizontal</enum>
-   </property>
-   <property name="standardButtons">
-    <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-   </property>
-  </widget>
-  <widget class="QWidget" name="layoutWidget">
-   <property name="geometry">
-    <rect>
-     <x>20</x>
-     <y>20</y>
-     <width>231</width>
-     <height>78</height>
-    </rect>
-   </property>
-   <layout class="QHBoxLayout" name="horizontalLayout">
-    <item>
-     <widget class="Line" name="line">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <layout class="QVBoxLayout" name="verticalLayout">
-      <item>
-       <widget class="QPushButton" name="savepath">
-        <property name="text">
-         <string>path to save</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QLabel" name="label_2">
-        <property name="text">
-         <string>result threshold</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QLabel" name="label_3">
-        <property name="text">
-         <string>load threshold</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </item>
-    <item>
-     <layout class="QVBoxLayout" name="verticalLayout_2">
-      <item>
-       <widget class="QLineEdit" name="linepath">
-        <property name="text">
-         <string>/localdata/</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QSpinBox" name="result_thres">
-        <property name="maximum">
-         <number>9999999</number>
-        </property>
-        <property name="singleStep">
-         <number>10000</number>
-        </property>
-        <property name="value">
-         <number>250000</number>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QSpinBox" name="load_thres">
-        <property name="maximum">
-         <number>9999999</number>
-        </property>
-        <property name="singleStep">
-         <number>10000</number>
-        </property>
-        <property name="value">
-         <number>100000</number>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QTextBrowser" name="textBrowser">
-   <property name="geometry">
-    <rect>
-     <x>280</x>
-     <y>10</y>
-     <width>271</width>
-     <height>131</height>
-    </rect>
-   </property>
-   <property name="html">
-    <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Current Version Remarks:&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;- Default Values for thresholds: &lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;        results = 250000&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;        load      = 100000&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;- it is recommended to keep threshold values as low as possible&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;- gridfinder shows you the complete number of results, but only saves up to the result threshold value&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;-when using FFTW / Temperton, always activate strict matching (for now)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-   </property>
-  </widget>
- </widget>
- <resources/>
- <connections/>
-</ui>
Index: palm/trunk/SCRIPTS/palm_gf_files/palm_gf_table.ui
===================================================================
--- palm/trunk/SCRIPTS/palm_gf_files/palm_gf_table.ui	(revision 4843)
+++ palm/trunk/SCRIPTS/palm_gf_files/palm_gf_table.ui	(revision 4869)
@@ -8,5 +8,5 @@
     <y>0</y>
     <width>1030</width>
-    <height>439</height>
+    <height>536</height>
    </rect>
   </property>
@@ -20,5 +20,5 @@
      <y>166</y>
      <width>1005</width>
-     <height>266</height>
+     <height>361</height>
     </rect>
    </property>
@@ -38,4 +38,7 @@
     <bool>true</bool>
    </property>
+   <property name="editTriggers">
+    <set>QAbstractItemView::NoEditTriggers</set>
+   </property>
    <property name="dragEnabled">
     <bool>false</bool>
@@ -48,5 +51,5 @@
    </property>
    <property name="selectionBehavior">
-    <enum>QAbstractItemView::SelectItems</enum>
+    <enum>QAbstractItemView::SelectRows</enum>
    </property>
    <property name="sortingEnabled">
@@ -54,5 +57,5 @@
    </property>
    <property name="rowCount">
-    <number>8</number>
+    <number>11</number>
    </property>
    <property name="columnCount">
@@ -75,4 +78,19 @@
    <row>
     <property name="text">
+     <string>11</string>
+    </property>
+   </row>
+   <row>
+    <property name="text">
+     <string>10</string>
+    </property>
+   </row>
+   <row>
+    <property name="text">
+     <string>9</string>
+    </property>
+   </row>
+   <row>
+    <property name="text">
      <string>8</string>
     </property>
@@ -150,5 +168,5 @@
    <property name="geometry">
     <rect>
-     <x>831</x>
+     <x>847</x>
      <y>60</y>
      <width>30</width>
@@ -163,6 +181,6 @@
    <property name="geometry">
     <rect>
-     <x>851</x>
-     <y>112</y>
+     <x>867</x>
+     <y>52</y>
      <width>131</width>
      <height>17</height>
@@ -176,5 +194,5 @@
    <property name="geometry">
     <rect>
-     <x>145</x>
+     <x>161</x>
      <y>110</y>
      <width>62</width>
@@ -210,5 +228,5 @@
    <property name="geometry">
     <rect>
-     <x>208</x>
+     <x>224</x>
      <y>110</y>
      <width>62</width>
@@ -244,5 +262,5 @@
    <property name="geometry">
     <rect>
-     <x>271</x>
+     <x>287</x>
      <y>110</y>
      <width>62</width>
@@ -278,5 +296,5 @@
    <property name="geometry">
     <rect>
-     <x>334</x>
+     <x>350</x>
      <y>110</y>
      <width>62</width>
@@ -312,5 +330,5 @@
    <property name="geometry">
     <rect>
-     <x>397</x>
+     <x>413</x>
      <y>110</y>
      <width>62</width>
@@ -346,5 +364,5 @@
    <property name="geometry">
     <rect>
-     <x>460</x>
+     <x>476</x>
      <y>110</y>
      <width>62</width>
@@ -377,5 +395,5 @@
    <property name="geometry">
     <rect>
-     <x>523</x>
+     <x>539</x>
      <y>110</y>
      <width>62</width>
@@ -408,57 +426,8 @@
    </property>
   </widget>
-  <widget class="QSpinBox" name="ngpts_max">
-   <property name="geometry">
-    <rect>
-     <x>587</x>
-     <y>110</y>
-     <width>80</width>
-     <height>22</height>
-    </rect>
-   </property>
-   <property name="sizePolicy">
-    <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-     <horstretch>0</horstretch>
-     <verstretch>0</verstretch>
-    </sizepolicy>
-   </property>
-   <property name="minimumSize">
-    <size>
-     <width>80</width>
-     <height>22</height>
-    </size>
-   </property>
-   <property name="maximumSize">
-    <size>
-     <width>80</width>
-     <height>22</height>
-    </size>
-   </property>
-   <property name="autoFillBackground">
-    <bool>false</bool>
-   </property>
-   <property name="wrapping">
-    <bool>false</bool>
-   </property>
-   <property name="frame">
-    <bool>true</bool>
-   </property>
-   <property name="buttonSymbols">
-    <enum>QAbstractSpinBox::UpDownArrows</enum>
-   </property>
-   <property name="correctionMode">
-    <enum>QAbstractSpinBox::CorrectToNearestValue</enum>
-   </property>
-   <property name="maximum">
-    <number>99999999</number>
-   </property>
-   <property name="value">
-    <number>0</number>
-   </property>
-  </widget>
-  <widget class="QLabel" name="label_2">
-   <property name="geometry">
-    <rect>
-     <x>115</x>
+  <widget class="QLabel" name="max_label">
+   <property name="geometry">
+    <rect>
+     <x>131</x>
      <y>107</y>
      <width>47</width>
@@ -470,8 +439,8 @@
    </property>
   </widget>
-  <widget class="QLabel" name="label">
-   <property name="geometry">
-    <rect>
-     <x>115</x>
+  <widget class="QLabel" name="min_label">
+   <property name="geometry">
+    <rect>
+     <x>131</x>
      <y>83</y>
      <width>48</width>
@@ -486,5 +455,5 @@
    <property name="geometry">
     <rect>
-     <x>146</x>
+     <x>162</x>
      <y>86</y>
      <width>62</width>
@@ -520,5 +489,5 @@
    <property name="geometry">
     <rect>
-     <x>209</x>
+     <x>225</x>
      <y>86</y>
      <width>62</width>
@@ -554,5 +523,5 @@
    <property name="geometry">
     <rect>
-     <x>272</x>
+     <x>288</x>
      <y>86</y>
      <width>62</width>
@@ -588,5 +557,5 @@
    <property name="geometry">
     <rect>
-     <x>335</x>
+     <x>351</x>
      <y>86</y>
      <width>62</width>
@@ -622,5 +591,5 @@
    <property name="geometry">
     <rect>
-     <x>398</x>
+     <x>414</x>
      <y>86</y>
      <width>62</width>
@@ -656,5 +625,5 @@
    <property name="geometry">
     <rect>
-     <x>461</x>
+     <x>477</x>
      <y>86</y>
      <width>62</width>
@@ -687,5 +656,5 @@
    <property name="geometry">
     <rect>
-     <x>524</x>
+     <x>540</x>
      <y>86</y>
      <width>62</width>
@@ -718,45 +687,11 @@
    </property>
   </widget>
-  <widget class="QSpinBox" name="ngpts_min">
-   <property name="geometry">
-    <rect>
-     <x>587</x>
-     <y>86</y>
-     <width>80</width>
-     <height>22</height>
-    </rect>
-   </property>
-   <property name="sizePolicy">
-    <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-     <horstretch>0</horstretch>
-     <verstretch>0</verstretch>
-    </sizepolicy>
-   </property>
-   <property name="minimumSize">
-    <size>
-     <width>80</width>
-     <height>22</height>
-    </size>
-   </property>
-   <property name="maximumSize">
-    <size>
-     <width>80</width>
-     <height>22</height>
-    </size>
-   </property>
-   <property name="correctionMode">
-    <enum>QAbstractSpinBox::CorrectToNearestValue</enum>
-   </property>
-   <property name="maximum">
-    <number>99999999</number>
-   </property>
-  </widget>
-  <widget class="QLabel" name="label_12">
-   <property name="geometry">
-    <rect>
-     <x>851</x>
-     <y>70</y>
-     <width>52</width>
-     <height>14</height>
+  <widget class="QLabel" name="status_text">
+   <property name="geometry">
+    <rect>
+     <x>867</x>
+     <y>66</y>
+     <width>61</width>
+     <height>20</height>
     </rect>
    </property>
@@ -768,6 +703,6 @@
    <property name="geometry">
     <rect>
-     <x>851</x>
-     <y>90</y>
+     <x>867</x>
+     <y>30</y>
      <width>131</width>
      <height>16</height>
@@ -781,5 +716,5 @@
    <property name="geometry">
     <rect>
-     <x>100</x>
+     <x>120</x>
      <y>55</y>
      <width>8</width>
@@ -791,8 +726,8 @@
    </property>
   </widget>
-  <widget class="QLabel" name="label_3">
-   <property name="geometry">
-    <rect>
-     <x>149</x>
+  <widget class="QLabel" name="nx_label">
+   <property name="geometry">
+    <rect>
+     <x>165</x>
      <y>67</y>
      <width>58</width>
@@ -822,5 +757,5 @@
    </property>
   </widget>
-  <widget class="QLabel" name="label_4">
+  <widget class="QLabel" name="ny_label">
    <property name="enabled">
     <bool>true</bool>
@@ -828,5 +763,5 @@
    <property name="geometry">
     <rect>
-     <x>213</x>
+     <x>229</x>
      <y>67</y>
      <width>57</width>
@@ -856,8 +791,8 @@
    </property>
   </widget>
-  <widget class="QLabel" name="label_5">
-   <property name="geometry">
-    <rect>
-     <x>275</x>
+  <widget class="QLabel" name="nz_label">
+   <property name="geometry">
+    <rect>
+     <x>291</x>
      <y>67</y>
      <width>57</width>
@@ -887,8 +822,8 @@
    </property>
   </widget>
-  <widget class="QLabel" name="label_6">
-   <property name="geometry">
-    <rect>
-     <x>340</x>
+  <widget class="QLabel" name="npex_label">
+   <property name="geometry">
+    <rect>
+     <x>356</x>
      <y>67</y>
      <width>57</width>
@@ -918,8 +853,8 @@
    </property>
   </widget>
-  <widget class="QLabel" name="label_8">
-   <property name="geometry">
-    <rect>
-     <x>400</x>
+  <widget class="QLabel" name="npey_label">
+   <property name="geometry">
+    <rect>
+     <x>416</x>
      <y>67</y>
      <width>57</width>
@@ -949,28 +884,28 @@
    </property>
   </widget>
-  <widget class="QLabel" name="label_7">
-   <property name="geometry">
-    <rect>
-     <x>461</x>
+  <widget class="QLabel" name="npxnpy_label">
+   <property name="geometry">
+    <rect>
+     <x>470</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>
+     <width>65</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>65</width>
+     <height>19</height>
+    </size>
+   </property>
+   <property name="maximumSize">
+    <size>
+     <width>65</width>
      <height>19</height>
     </size>
@@ -980,8 +915,8 @@
    </property>
   </widget>
-  <widget class="QLabel" name="label_9">
-   <property name="geometry">
-    <rect>
-     <x>525</x>
+  <widget class="QLabel" name="np_label">
+   <property name="geometry">
+    <rect>
+     <x>541</x>
      <y>67</y>
      <width>57</width>
@@ -1011,8 +946,8 @@
    </property>
   </widget>
-  <widget class="QLabel" name="label_10">
-   <property name="geometry">
-    <rect>
-     <x>590</x>
+  <widget class="QLabel" name="ngpts_label">
+   <property name="geometry">
+    <rect>
+     <x>606</x>
      <y>67</y>
      <width>57</width>
@@ -1189,17 +1124,23 @@
     <rect>
      <x>5</x>
-     <y>25</y>
-     <width>97</width>
-     <height>106</height>
+     <y>10</y>
+     <width>111</width>
+     <height>131</height>
     </rect>
    </property>
    <layout class="QVBoxLayout" name="verticalLayout">
     <item>
-     <widget class="QPushButton" name="save_to_file_button">
+     <widget class="QPushButton" name="save_button">
       <property name="enabled">
-       <bool>false</bool>
+       <bool>true</bool>
+      </property>
+      <property name="minimumSize">
+       <size>
+        <width>0</width>
+        <height>25</height>
+       </size>
       </property>
       <property name="toolTip">
-       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Currently Disabled&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Save SELECTED results&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
       </property>
       <property name="text">
@@ -1209,7 +1150,13 @@
     </item>
     <item>
-     <widget class="QPushButton" name="pushButton_3">
+     <widget class="QPushButton" name="load_all_button">
+      <property name="minimumSize">
+       <size>
+        <width>0</width>
+        <height>25</height>
+       </size>
+      </property>
       <property name="toolTip">
-       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Loads all calculated results. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Load all data that was previously calculated.&lt;/p&gt;&lt;p&gt;CAUTION: Can take some time to load&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
       </property>
       <property name="text">
@@ -1219,5 +1166,14 @@
     </item>
     <item>
-     <widget class="QPushButton" name="pushButton">
+     <widget class="QPushButton" name="exec_button">
+      <property name="minimumSize">
+       <size>
+        <width>0</width>
+        <height>25</height>
+       </size>
+      </property>
+      <property name="toolTip">
+       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Loads results that fit within set minima/maxima&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+      </property>
       <property name="text">
        <string>Execute filter</string>
@@ -1226,5 +1182,14 @@
     </item>
     <item>
-     <widget class="QPushButton" name="pushButton_2">
+     <widget class="QPushButton" name="reset_button">
+      <property name="minimumSize">
+       <size>
+        <width>0</width>
+        <height>25</height>
+       </size>
+      </property>
+      <property name="toolTip">
+       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Reset Min/Max to original values&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+      </property>
       <property name="text">
        <string>Reset limits</string>
@@ -1266,28 +1231,28 @@
    </property>
   </widget>
-  <widget class="QLabel" name="label_13">
-   <property name="geometry">
-    <rect>
-     <x>677</x>
+  <widget class="QLabel" name="nxnpex_label">
+   <property name="geometry">
+    <rect>
+     <x>693</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>
+     <width>65</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>65</width>
+     <height>19</height>
+    </size>
+   </property>
+   <property name="maximumSize">
+    <size>
+     <width>65</width>
      <height>19</height>
     </size>
@@ -1297,28 +1262,28 @@
    </property>
   </widget>
-  <widget class="QLabel" name="label_14">
-   <property name="geometry">
-    <rect>
-     <x>755</x>
+  <widget class="QLabel" name="nynpey_label">
+   <property name="geometry">
+    <rect>
+     <x>771</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>
+     <width>65</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>65</width>
+     <height>19</height>
+    </size>
+   </property>
+   <property name="maximumSize">
+    <size>
+     <width>65</width>
      <height>19</height>
     </size>
@@ -1331,5 +1296,5 @@
    <property name="geometry">
     <rect>
-     <x>670</x>
+     <x>686</x>
      <y>86</y>
      <width>71</width>
@@ -1344,5 +1309,5 @@
    <property name="geometry">
     <rect>
-     <x>670</x>
+     <x>686</x>
      <y>110</y>
      <width>71</width>
@@ -1357,5 +1322,5 @@
    <property name="geometry">
     <rect>
-     <x>747</x>
+     <x>763</x>
      <y>86</y>
      <width>71</width>
@@ -1370,5 +1335,5 @@
    <property name="geometry">
     <rect>
-     <x>747</x>
+     <x>763</x>
      <y>110</y>
      <width>71</width>
@@ -1380,7 +1345,93 @@
    </property>
   </widget>
+  <widget class="QLabel" name="status_label">
+   <property name="geometry">
+    <rect>
+     <x>870</x>
+     <y>90</y>
+     <width>151</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string/>
+   </property>
+  </widget>
+  <widget class="QDoubleSpinBox" name="ngpts_max">
+   <property name="geometry">
+    <rect>
+     <x>603</x>
+     <y>110</y>
+     <width>80</width>
+     <height>22</height>
+    </rect>
+   </property>
+   <property name="sizePolicy">
+    <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+     <horstretch>0</horstretch>
+     <verstretch>0</verstretch>
+    </sizepolicy>
+   </property>
+   <property name="minimumSize">
+    <size>
+     <width>80</width>
+     <height>22</height>
+    </size>
+   </property>
+   <property name="maximumSize">
+    <size>
+     <width>80</width>
+     <height>22</height>
+    </size>
+   </property>
+   <property name="correctionMode">
+    <enum>QAbstractSpinBox::CorrectToNearestValue</enum>
+   </property>
+   <property name="decimals">
+    <number>0</number>
+   </property>
+   <property name="maximum">
+    <double>9999999999999999464902769475481793196872414789632.000000000000000</double>
+   </property>
+  </widget>
+  <widget class="QDoubleSpinBox" name="ngpts_min">
+   <property name="geometry">
+    <rect>
+     <x>603</x>
+     <y>86</y>
+     <width>80</width>
+     <height>22</height>
+    </rect>
+   </property>
+   <property name="sizePolicy">
+    <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+     <horstretch>0</horstretch>
+     <verstretch>0</verstretch>
+    </sizepolicy>
+   </property>
+   <property name="minimumSize">
+    <size>
+     <width>80</width>
+     <height>22</height>
+    </size>
+   </property>
+   <property name="maximumSize">
+    <size>
+     <width>80</width>
+     <height>22</height>
+    </size>
+   </property>
+   <property name="correctionMode">
+    <enum>QAbstractSpinBox::CorrectToNearestValue</enum>
+   </property>
+   <property name="decimals">
+    <number>0</number>
+   </property>
+   <property name="maximum">
+    <double>10000000000000000725314363815292351261583744096465219555182101554790400.000000000000000</double>
+   </property>
+  </widget>
  </widget>
  <tabstops>
-  <tabstop>pushButton_3</tabstop>
   <tabstop>nx_min</tabstop>
   <tabstop>nx_max</tabstop>
@@ -1397,8 +1448,5 @@
   <tabstop>np_min</tabstop>
   <tabstop>np_max</tabstop>
-  <tabstop>ngpts_min</tabstop>
-  <tabstop>ngpts_max</tabstop>
-  <tabstop>pushButton</tabstop>
-  <tabstop>pushButton_2</tabstop>
+  <tabstop>reset_button</tabstop>
   <tabstop>tableWidget</tabstop>
  </tabstops>
Index: palm/trunk/SCRIPTS/palm_gf_files/palm_gf_tools.py
===================================================================
--- palm/trunk/SCRIPTS/palm_gf_files/palm_gf_tools.py	(revision 4843)
+++ palm/trunk/SCRIPTS/palm_gf_files/palm_gf_tools.py	(revision 4869)
@@ -1,62 +1,18 @@
 #!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#--------------------------------------------------------------------------------#
-# This file is part of the PALM model system.
-#
-# PALM is free software: you can redistribute it and/or modify it under the terms
-# of the GNU General Public License as published by the Free Software Foundation,
-# either version 3 of the License, or (at your option) any later version.
-#
-# PALM is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# PALM. If not, see <http://www.gnu.org/licenses/>.
-#
-# Copyright 1997-2021  Leibniz Universitaet Hannover
-#--------------------------------------------------------------------------------#
-#
-# Current revisions:
-# -----------------
-# 
-# 
-# Former revisions:
-# -----------------
-# $Id$
-# Initial revision
-# 
-# 
-#
-# 
-#
-# Description:
-# ------------
-# 
-#
-# Instructions:
-# -------------
-#
-#------------------------------------------------------------------------------!
-
+from PyQt5 import QtWidgets, uic
+from PyQt5.QtWidgets import QFileDialog
 import sys
+import sqlite3
 import os
-import sqlite3
-from PyQt4 import QtCore, QtGui, uic
-import subprocess as sub
-import palm_gf_conf as configwr
-   
+
 palm_dir = os.getcwd()
 palm_bin = palm_dir + '/trunk/SCRIPTS'
 
-qtCreatorFile = palm_bin + '/palm_gf_files/palm_gf_table.ui'
-
-Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile)
-
-class MyApp3(QtGui.QMainWindow, Ui_MainWindow):
-
-    class MyTableWidgetItem(QtGui.QTableWidgetItem):
+
+class MyTable(QtWidgets.QDialog):
+
+    class MyTableWidgetItem(QtWidgets.QTableWidgetItem):
         def __init__(self, text, sortKey):
-            QtGui.QTableWidgetItem.__init__(self, text, QtGui.QTableWidgetItem.UserType)
+            QtWidgets.QTableWidgetItem.__init__(self, text, QtWidgets.QTableWidgetItem.UserType)
             self.sortKey = sortKey
 
@@ -64,33 +20,11 @@
             return self.sortKey < other.sortKey
 
-    def __init__(self):   #     def __init__(self, parent=None):
-        QtGui.QMainWindow.__init__(self)
-        Ui_MainWindow.__init__(self)
-
-        framegm = self.frameGeometry()
-        screen = QtGui.QApplication.desktop().screenNumber(QtGui.QApplication.desktop().cursor().pos())
-        centerpoint = QtGui.QApplication.desktop().screenGeometry(screen).center()
-        framegm.moveCenter(centerpoint)
-
-        #centerpoint = str(centerpoint)
-        #xcenter = centerpoint.split('(')[1].split(',')[0]
-        #ycenter = centerpoint.split('(')[1].split(',')[1].split(')')[0]
-        ##print xcenter, ycenter
-        #centerpoint = QtCore.QPoint(int(xcenter) + 418, int(ycenter))
-        #framegm.moveCenter(centerpoint)
-        self.move(framegm.topLeft())
-
-
-
-        self.setupUi(self)
-        self.pushButton_3.clicked.connect(self.load_result)
-        #self.nx_min.valueChanged.connect(self.check)
-        self.load_trigger()
-        self.pushButton.clicked.connect(self.filter_results)
-        #self.Sortnow_button.clicked.connect(self.sort_order)
-        self.pushButton_2.clicked.connect(self.load_trigger)
-        self.tableWidget.horizontalHeader().setClickable(True)
-
-
+    def __init__(self):
+        super(MyTable, self).__init__()
+        uic.loadUi(palm_bin + '/palm_gf_files/palm_gf_table.ui', self)
+        self.center_window()
+        self.load_limits()
+        self.exec_button.clicked.connect(self.filter_data)
+        # connects labels of table to sorting subroutine
         self.nx_table.clicked.connect(lambda: self.sort_table(str("nx")))
         self.ny_table.clicked.connect(lambda: self.sort_table(str("ny")))
@@ -98,94 +32,87 @@
         self.npex_table.clicked.connect(lambda: self.sort_table(str("npex")))
         self.npey_table.clicked.connect(lambda: self.sort_table(str("npey")))
-        self.npexnpey_table.clicked.connect(lambda: self.sort_table(str("npexnpey")))
+        self.npexnpey_table.clicked.connect(lambda: self.sort_table(str("pxpy")))
         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()
-
-        self.save_to_file_button.clicked.connect(self.get_path)
-
-    def instant(self):
-        checkfile = open(".palm_gf_tmp", "r")
-        # self.result_label.setText(str(checkfile.readline()))
-        res_text = str(checkfile.readline())  # XXX
-        result_nr = res_text.split(' ')[2]
-        checkfile.close()
-        if int(result_nr) < 100000:
-            self.load_result()
-
-
-
-    def load_trigger(self):
-        pathx = configwr.read_config()
-        pathx = pathx[19]
-
-
-        dtb = str('.palm_gf_data.db')
-        #con = sqlite3.connect("/localdata/.palm_gf_data.db")
-
-        pathx = pathx + '/.palm_gf_data.db'
-        con = sqlite3.connect(pathx)
+        # connects main buttons to subroutines
+        self.load_all_button.clicked.connect(self.load_all)
+        self.reset_button.clicked.connect(self.load_limits)
+        self.save_button.clicked.connect(self.save)
+
+    def center_window(self):
+        # centers window in the middle of screen
+        frame = self.frameGeometry()
+        center = QtWidgets.QDesktopWidget().availableGeometry().center()
+        frame.moveCenter(center)
+        self.move(frame.topLeft())
+
+    def load_limits(self):
+        # reads out the .db and sets limits of results as Min/Max
+        con = sqlite3.connect('palm_gf_data.db')
         c = con.cursor()
         c.execute("SELECT * FROM " + 'grid_limits')
-        mini = c.fetchone()
-        max = c.fetchone()
-        self.nx_min.setValue(mini[0])
-        self.nx_max.setValue(max[0])
-
-        self.ny_min.setValue(mini[1])
-        self.ny_max.setValue(max[1])
-        self.nz_min.setValue(mini[2])
-        self.nz_max.setValue(max[2])
-        self.npex_min.setValue(mini[3])
-        self.npex_max.setValue(max[3])
-        self.npey_min.setValue(mini[4])
-        self.npey_max.setValue(max[4])
-        self.npxnpy_min.setValue(mini[5])
-        self.npxnpy_max.setValue(max[5])
-        self.np_min.setValue(mini[6])
-        self.np_max.setValue(max[6])
-        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])
-        self.nx_max.setMaximum(max[0])
-        self.ny_min.setMinimum(mini[1])
-        self.ny_max.setMaximum(max[1])
-        self.nz_min.setMinimum(mini[2])
-        self.nz_max.setMaximum(max[2])
-        self.npex_min.setMinimum(mini[3])
-        self.npex_max.setMaximum(max[3])
-        self.npey_min.setMinimum(mini[4])
-        self.npey_max.setMaximum(max[4])
-        self.npxnpy_min.setMinimum(mini[5])
-        self.npxnpy_max.setMaximum(max[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])
-        self.ngpts_min.setMaximum(max[7])
-        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])
-
-
-
-
+        Min = c.fetchone()
+        Max = c.fetchone()
+
+        self.nx_min.setValue(Min[0])
+        self.nx_min.setMinimum(Min[0])
+        self.nx_max.setValue(Max[0])
+        self.nx_max.setMaximum(Max[0])
+
+        self.ny_min.setValue(Min[1])
+        self.ny_min.setMinimum(Min[1])
+        self.ny_max.setValue(Max[1])
+        self.ny_max.setMaximum(Max[1])
+
+        self.nz_min.setValue(Min[2])
+        self.nz_min.setMinimum(Min[2])
+        self.nz_max.setValue(Max[2])
+        self.nz_max.setMaximum(Max[2])
+
+        self.npex_min.setValue(Min[3])
+        self.npex_min.setMinimum(Min[3])
+        self.npex_max.setValue(Max[3])
+        self.npex_max.setMaximum(Max[3])
+
+        self.npey_min.setValue(Min[4])
+        self.npey_min.setMinimum(Min[4])
+        self.npey_max.setValue(Max[4])
+        self.npey_max.setMaximum(Max[4])
+
+        self.npxnpy_min.setValue(Min[5])
+        self.npxnpy_min.setMinimum(Min[5])
+        self.npxnpy_max.setValue(Max[5])
+        self.npxnpy_max.setMaximum(Max[5])
+
+        self.np_min.setValue(Min[6])
+        self.np_min.setMinimum(Min[6])
+        self.np_max.setValue(Max[6])
+        self.np_max.setMaximum(Max[6])
+        # try statement, as ngpts could be too huge to handle for PyQt5 (>10^8)
+        try:
+            self.ngpts_min.setValue(Min[7])
+            self.ngpts_min.setMinimum(Min[7])
+            self.ngpts_max.setValue(Max[7])
+            self.ngpts_max.setMaximum(Max[7])
+
+        except OverflowError:
+            self.ngpts_min.setEnabled(False)
+            self.ngpts_max.setEnabled(False)
+            self.ngpts_table.setEnabled(False)
+            self.ngpts_label.setStyleSheet('color: grey')
+            self.exec_button.setEnabled(False)
+            self.status_label.setText('ngpts overflow')
+
+        self.nxpex_min.setValue(Min[8])
+        self.nxpex_min.setMinimum(Min[8])
+        self.nxpex_max.setValue(Max[8])
+        self.nxpex_max.setMaximum(Max[8])
+
+        self.nypey_min.setValue(Min[9])
+        self.nypey_min.setMinimum(Min[9])
+        self.nypey_max.setValue(Max[9])
+        self.nypey_max.setMaximum(Max[9])
 
         con.commit()
@@ -193,172 +120,72 @@
         con.close()
 
-
-
-
-    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(pathx + '/.palm_gf_data.db')
+    def load_all(self):
+        # shows all results found in .db file
+        con = sqlite3.connect('palm_gf_data.db')
         c = con.cursor()
-        c.execute("SELECT * FROM " + 'grid_limits')
-        mini = c.fetchone()
-        max = c.fetchone()
-        if self.nx_min.value() < mini[0]:
-
-            self.nx_min.setValue(mini[0])
-
-
-    def process1(self):
-        self.calc_label.setText('loading...')
-        QtGui.QApplication.processEvents()
-
-
-
-    def load_result(self):
-        #print("LOADED!!!")
-        import decimal
-
-        pathx = configwr.read_config()
-        pathx = pathx[19]
-
-        self.setEnabled(False)
-        QtGui.QApplication.processEvents()
-        self.load_trigger()
-        self.process1()
-        database = str('.palm_gf_data.db')
-        conn = sqlite3.connect(pathx + '/.palm_gf_data.db')
-        c = conn.cursor()
         c.execute("SELECT * FROM " + 'grid_current')
-        results = c.fetchall()
-
-        self.tableWidget.setRowCount(len(results))
-
-        i = 0
-        j = 0
-        k = 0
-
-        while i < len(results):
-            line = results[i]
-            while j < 10:
-                var = line[j]
+        data = c.fetchall()
+
+        self.tableWidget.setRowCount(len(data))
+        row_cnt = -1
+        for i in range(0, len(data)):
+            line = data[i]
+            row_cnt += 1
+            for j in range(0, 10):
+                value = line[j]
 
                 if j == 7:
-                    self.tableWidget.setItem(i, j, self.MyTableWidgetItem(str("%.1e" % var), j + i))
-                    #print("%.2e" % int(var), "%.4e" % int(1782))
+                    self.tableWidget.setItem(row_cnt, j, self.MyTableWidgetItem(
+                        str("%.1e" % value), i))
 
                 else:
-                    self.tableWidget.setItem(i, j, self.MyTableWidgetItem(str(var), j+i))
-                #item = self.MyTableWidgetItem(str(var), k)
-                #self.tableWidget.setItem(i, j, item)
-
-                j += 1
-                #if j == 3:
-                    #print(k)
-                #k += 1
-            #k -= 7
-            k += 1
-            j = 0
-            i += 1
+                    self.tableWidget.setItem(row_cnt, j, self.MyTableWidgetItem(
+                        str(value), i))
 
         c.close()
-        conn.close()
-        self.calc_label.setText('loading completed')
-        self.label_11.setText(str(len(results)) + ' results ')
-        self.setEnabled(True)
-        QtGui.QApplication.processEvents()
-
-    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(pathx + '/.palm_gf_data.db')
-        c = conn.cursor()
-        c.execute("SELECT * FROM " + "grid_current")
-        results = c.fetchall()
-        #print(results)
-
-        self.tableWidget.setRowCount(len(results))
-
-        i = 0
-        j = 0
+        con.close()
+        self.tableWidget.setRowCount(row_cnt + 1)
+        self.status_label.setText(str(row_cnt + 1) + ' results loaded')
+
+    def filter_data(self):
+        # filters data according to set Min/Max. Reads out .db to find all fitting data
+        con = sqlite3.connect('palm_gf_data.db')
+        c = con.cursor()
+        c.execute("SELECT * FROM " + 'grid_current')
+        data = c.fetchall()
+
+        self.tableWidget.setRowCount(len(data))
+
         row_cnt = -1
-        while i < len(results):
-            line = results[i]
-
-            if line[0] <= self.nx_max.value():
-
-                if line[0] >= self.nx_min.value():
-
-                    if line[1] <= self.ny_max.value():
-
-                        if line[1] >= self.ny_min.value():
-
-                            if line[2] <= self.nz_max.value():
-
-                                if line[2] >= self.nz_min.value():
-
-                                    if line[3] <= self.npex_max.value():
-
-                                        if line[3] >= self.npex_min.value():
-
-                                            if line[4] <= self.npey_max.value():
-
-                                                if line[4] >= self.npey_min.value():
-
-                                                    if line[5] <= self.npxnpy_max.value():
-
-                                                        if line[5] >= self.npxnpy_min.value():
-
-                                                            if line[6] <= self.np_max.value():
-
-                                                                if line[6] >= self.np_min.value():
-
-                                                                    if line[7] <= self.ngpts_max.value():
-
-                                                                        if line[7] >= self.ngpts_min.value():
-
-                                                                            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
-            i += 1
+        for i in range(0, len(data)):
+            line = data[i]
+            if self.nx_min.value() <= line[0] <= self.nx_max.value():
+                if self.ny_min.value() <= line[1] <= self.ny_max.value():
+                    if self.nz_min.value() <= line[2] <= self.nz_max.value():
+                        if self.npex_min.value() <= line[3] <= self.npex_max.value():
+                            if self.npey_min.value() <= line[4] <= self.npey_max.value():
+                                if self.npxnpy_min.value() <= line[5] <= self.npxnpy_max.value():
+                                    if self.np_min.value() <= line[6] <= self.np_max.value():
+                                        if self.ngpts_min.value() <= line[7] <= self.ngpts_max.value():
+                                            if self.nxpex_min.value() <= line[8] <= self.nxpex_max.value():
+                                                if self.nypey_min.value() <= line[9] <= self.nypey_max.value():
+                                                    row_cnt += 1
+                                                    for j in range(0, 10):
+                                                        value = line[j]
+
+                                                        if j == 7:
+                                                            self.tableWidget.setItem(row_cnt, j, self.MyTableWidgetItem(
+                                                                str("%.1e" % value), i))
+                                                        else:
+                                                            self.tableWidget.setItem(row_cnt, j, self.MyTableWidgetItem(
+                                                                str(value), i))
 
         c.close()
-        conn.close()
+        con.close()
         self.tableWidget.setRowCount(row_cnt + 1)
-        self.setEnabled(True)
-        self.calc_label.setText('calculation completed')
-        self.label_11.setText(str(row_cnt + 1) + ' results')
-        QtGui.QApplication.processEvents()
-
-
+        self.status_label.setText(str(row_cnt + 1) + ' results found')
 
     def sort_table(self, column):
-
+        # with argument as chosen column, read not from table but from .db and reloads sorted data into table
         fnx_mn = self.nx_min.value()
         fnx_mx = self.nx_max.value()
@@ -382,20 +209,14 @@
         nypey_mx = self.nypey_max.value()
 
-
-        if column == str("nx"):
-            sorted_col = "nx"
-
+        if column == 'nx':
+            sorted_col = 'nx'
             if self.nx_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)
+            else:
+                order = " ASC"
+            self.ny_table.setChecked(False)
+            self.nz_table.setChecked(False)
+            self.npex_table.setChecked(False)
+            self.npey_table.setChecked(False)
             self.np_table.setChecked(False)
             self.ngpts_table.setChecked(False)
@@ -405,10 +226,7 @@
         if column == str("ny"):
             sorted_col = "ny"
-
             if self.ny_table.isChecked() is True:
                 order = " DESC"
-
-            else:
-
+            else:
                 order = " ASC"
 
@@ -425,10 +243,7 @@
         if column == str("nz"):
             sorted_col = "nz"
-
             if self.nz_table.isChecked() is True:
                 order = " DESC"
-
-            else:
-
+            else:
                 order = " ASC"
 
@@ -445,10 +260,7 @@
         if column == str("npex"):
             sorted_col = "npex"
-
             if self.npex_table.isChecked() is True:
                 order = " DESC"
-
-            else:
-
+            else:
                 order = " ASC"
 
@@ -465,31 +277,24 @@
         if column == str("npey"):
             sorted_col = "npey"
-
             if self.npey_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.nx_table.setChecked(False)
-            self.npexnpey_table.setChecked(False)
-            self.np_table.setChecked(False)
-            self.ngpts_table.setChecked(False)
-            self.nxpex_table.setChecked(False)
-            self.nypey_table.setChecked(False)
-
-        if column == str("npexnpey"):
-            sorted_col = "npxnpy"
-
+            else:
+                order = " ASC"
+
+            self.ny_table.setChecked(False)
+            self.nz_table.setChecked(False)
+            self.npex_table.setChecked(False)
+            self.nx_table.setChecked(False)
+            self.npexnpey_table.setChecked(False)
+            self.np_table.setChecked(False)
+            self.ngpts_table.setChecked(False)
+            self.nxpex_table.setChecked(False)
+            self.nypey_table.setChecked(False)
+
+        if column == str("pxpy"):
+            sorted_col = "pxpy"
             if self.npexnpey_table.isChecked() is True:
                 order = " DESC"
-
-            else:
-
+            else:
                 order = " ASC"
 
@@ -506,10 +311,7 @@
         if column == str("np"):
             sorted_col = "np"
-
             if self.np_table.isChecked() is True:
                 order = " DESC"
-
-            else:
-
+            else:
                 order = " ASC"
 
@@ -526,10 +328,7 @@
         if column == str("ngpts"):
             sorted_col = "ngpts"
-
             if self.ngpts_table.isChecked() is True:
                 order = " DESC"
-
-            else:
-
+            else:
                 order = " ASC"
 
@@ -546,10 +345,7 @@
         if column == str("nxnpex"):
             sorted_col = "nxnpex"
-
             if self.nxpex_table.isChecked() is True:
                 order = " DESC"
-
-            else:
-
+            else:
                 order = " ASC"
 
@@ -566,177 +362,81 @@
         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")
+            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)
+
+        conn = sqlite3.connect('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) +
+        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) +
                   " AND nz >= " + str(fnz_mn) + " AND npex <= " + str(fnpex_mx) + " AND npex >= " +
-        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))
-
-
+                  str(fnpex_mn) + " AND npey <= " + str(fnpey_mx) + " AND npey >= " + str(fnpey_mn) + " AND "
+                                                                                                      "pxpy <= " + str(
+            fnpxnpy_mx) + " AND pxpy >= " + 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))
 
         sorted = c.fetchall()
-
-
         c.close()
         conn.close()
         self.tableWidget.setRowCount(len(sorted))
-
-        for row_indx in range(0,len(sorted)):
-
-            for col_indx in range(0,10):
+        for row_indx in range(0, len(sorted)):
+            for col_indx in range(0, 10):
                 row = sorted[row_indx]
                 value = row[col_indx]
                 if col_indx == 7:
-                    self.tableWidget.setItem(row_indx, col_indx, QtGui.QTableWidgetItem(str("%.1e" % value)))
+                    self.tableWidget.setItem(row_indx, col_indx, self.MyTableWidgetItem(str("%.1e" % value), col_indx))
                 else:
-                    self.tableWidget.setItem(row_indx, col_indx, QtGui.QTableWidgetItem(str(value)))
-
-
-
-    def sort_order(self):
-
-        sorted = 0
-        fnx_mn = self.nx_min.value()
-        fnx_mx = self.nx_max.value()
-        fny_mn = self.ny_min.value()
-        fny_mx = self.ny_max.value()
-        fnz_mn = self.nz_min.value()
-        fnz_mx = self.nz_max.value()
-        fnpex_mn = self.npex_min.value()
-        fnpex_mx = self.npex_max.value()
-        fnpey_mn = self.npex_min.value()
-        fnpey_mx = self.npey_max.value()
-        fnpxnpy_mn = self.npxnpy_min.value()
-        fnpxnpy_mx = self.npxnpy_max.value()
-        fnp_mn = self.np_min.value()
-        fnp_mx = self.np_max.value()
-        fngpts_mn = self.ngpts_min.value()
-        fngpts_mx = self.ngpts_max.value()
-
-        if str(self.Sortvariable_box.currentIndex()) == str(1):
-
-
-            sorted_col = "nx"
-        if str(self.Sortvariable_box.currentIndex()) == str(2):
-
-            sorted_col = "ny"
-        if str(self.Sortvariable_box.currentIndex()) == str(3):
-
-            sorted_col = "nz"
-        if str(self.Sortvariable_box.currentIndex()) == str(4):
-
-            sorted_col = "npex"
-        if str(self.Sortvariable_box.currentIndex()) == str(5):
-
-            sorted_col = "npey"
-        if str(self.Sortvariable_box.currentIndex()) == str(6):
-
-            sorted_col = "npxnpy"
-        if str(self.Sortvariable_box.currentIndex()) == str(7):
-
-            sorted_col = "np"
-        if str(self.Sortvariable_box.currentIndex()) == str(8):
-
-            sorted_col = "ngpts"
-
-        #print(self.Sortvariable_box.currentIndex())
-
-        if str(self.Sortorder_box.currentIndex()) == str(1):
-
-            order = " ASC"
-
-        if str(self.Sortorder_box.currentIndex()) == str(2):
-
-            order = " DESC"
-
-
-
-        conn = sqlite3.connect("/localdata/.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) +
-                  " AND nz >= " + str(fnz_mn) + " AND npex <= " + str(fnpex_mx) + " AND npex >= " +
-        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) +
-        " ORDER BY " + str(sorted_col) + str(order))
-
-
-
-        sorted = c.fetchall()
-
-        c.close()
-        conn.close()
-        self.tableWidget.setRowCount(len(sorted))
-
-        for row_indx in range(0,len(sorted)):
-
-            for col_indx in range(0,8):
-                row = sorted[row_indx]
-                value = row[col_indx]
-                self.tableWidget.setItem(row_indx, col_indx, QtGui.QTableWidgetItem(str(var)))
-
-
-
-
-
-
-        #print(len(sorted))
-        #print(sorted)
-
-    def get_path(wildcard):
-        import wx
-        app = wx.App(None)
-        style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST
-        dialog = wx.FileDialog(None, 'Open', wildcard='*.db')
-        if dialog.ShowModal() == wx.ID_OK:
-            path = dialog.GetPath()
-
-            print(path, file)
-        else:
-            path = None
-        dialog.Destroy()
-        return
-
-
-
-
-
-
-
-
-
+                    self.tableWidget.setItem(row_indx, col_indx, self.MyTableWidgetItem(str(value), col_indx))
+
+        self.status_label.setText(str(len(sorted)) + ' results found')
+
+    def save_dialog(self):
+        # calling native PyQt5 Dialog to get desired save path
+        options = QFileDialog.Options()
+        options |= QFileDialog.DontUseNativeDialog
+        fileName, _ = QFileDialog.getSaveFileName(self, "Save .txt File", ".txt",
+                                                  "All Files (*.txt);;Text Files (*.txt)", options=options)
+        if fileName:
+            return fileName
+
+    def save(self):
+        # saves the file
+        # try because QFileDialog could be closed without choosing path
+        try:
+            if len(self.tableWidget.selectedItems()) != 0:
+                location = self.save_dialog()
+                data2safe = self.tableWidget.selectedItems()
+                if location is not None:
+                    with open(location, 'w') as file:
+                        file.write('nx  ' + 'ny  ' + 'nz  ' + 'npex  ' + 'npey' + "\n")
+                        for row in range(0, int(len(data2safe)), 10):
+                            file.write(str(data2safe[0+row].text()) + '  ' + str(data2safe[1+row].text()) + '  ' +
+                                       str(data2safe[2+row].text()) + '  ' + str(data2safe[3+row].text()) + '  ' +
+                                       str(data2safe[4+row].text()) + "\n")
+                    file.close()
+            else:
+                self.status_label.setText('Select to save')
+        except AttributeError:
+            pass
 
 
 if __name__ == "__main__":
-    app = QtGui.QApplication(sys.argv)
-    window = MyApp3()
-    window.setWindowTitle('Gridfilter')
+    app = QtWidgets.QApplication(sys.argv)
+    window = MyTable()
+    window.setWindowTitle('palm_gf Table')
     window.show()
     sys.exit(app.exec_())
-
