- Timestamp:
- Jan 17, 2017 7:21:59 AM (8 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 7b15990, a9f579c, 220b1e7
- Parents:
- ca6cbc1c (diff), 1dc8ec9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- src/sas/sasgui
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/customdir.py
r212bfc2 r73cbeec 34 34 if not os.path.isfile(config_file): 35 35 shutil.copyfile(os.path.join(path, "custom_config.py"), config_file) 36 37 #Adding SAS_OPENCL if it doesn't exist in the config file 38 # - to support backcompability 39 if not "SAS_OPENCL" in open(config_file).read(): 40 open(config_file,"a+").write("SAS_OPENCL = \"None\"\n") 36 41 except: 37 42 # Check for data path next to exe/zip file. -
src/sas/sasgui/guiframe/gui_manager.py
r505706a r73cbeec 152 152 SPLASH_SCREEN_HEIGHT = config.SPLASH_SCREEN_HEIGHT 153 153 SS_MAX_DISPLAY_TIME = config.SS_MAX_DISPLAY_TIME 154 SAS_OPENCL = config.SAS_OPENCL 154 155 if not WELCOME_PANEL_ON: 155 156 WELCOME_PANEL_SHOW = False … … 176 177 else: 177 178 DEFAULT_OPEN_FOLDER = PATH_APP 179 SAS_OPENCL = custom_config.SAS_OPENCL 178 180 except: 179 181 DATALOADER_SHOW = True … … 190 192 CLEANUP_PLOT = False 191 193 DEFAULT_OPEN_FOLDER = PATH_APP 192 194 SAS_OPENCL = None 193 195 DEFAULT_STYLE = config.DEFAULT_STYLE 194 196 … … 225 227 CHILD_FRAME = wx.Frame 226 228 229 #Initiliaze enviromental variable with custom setting but only if variable not set 230 if SAS_OPENCL and not "SAS_OPENCL" in os.environ: 231 os.environ["SAS_OPENCL"] = SAS_OPENCL 227 232 228 233 class ViewerFrame(PARENT_FRAME): … … 2104 2109 Quit the application 2105 2110 """ 2111 #IF SAS_OPENCL is set, settings are stored in the custom config file 2112 self._write_opencl_config_file() 2106 2113 logging.info(" --- SasView session was closed --- \n") 2107 2114 wx.Exit() 2108 2115 sys.exit() 2116 2117 def _write_opencl_config_file(self): 2118 """ 2119 Writes OpenCL settings to custom config file, so they can be remmbered 2120 from session to session 2121 """ 2122 if custom_config is not None: 2123 sas_opencl = os.environ.get("SAS_OPENCL",None) 2124 new_config_lines = [] 2125 config_file = open(custom_config.__file__) 2126 config_lines = config_file.readlines() 2127 for line in config_lines: 2128 if "SAS_OPENCL" in line: 2129 if sas_opencl: 2130 new_config_lines.append("SAS_OPENCL = \""+sas_opencl+"\"") 2131 else: 2132 new_config_lines.append("SAS_OPENCL = None") 2133 else: 2134 new_config_lines.append(line) 2135 config_file.close() 2136 2137 #If custom_config is None, settings will not be remmbered 2138 new_config_file = open(custom_config.__file__,"w") 2139 new_config_file.writelines(new_config_lines) 2140 new_config_file.close() 2141 else: 2142 logging.info("Failed to save OPENCL settings in custom config file") 2143 2109 2144 2110 2145 def _check_update(self, event=None): -
src/sas/sasgui/guiframe/startup_configuration.py
rd85c194 r73cbeec 31 31 'CLEANUP_PLOT':False, 32 32 'DEFAULT_PERSPECTIVE':'Fitting', 33 'DEFAULT_OPEN_FOLDER': None} 33 'DEFAULT_OPEN_FOLDER': None, 34 'SAS_OPENCL': None} 34 35 try: 35 36 CURRENT_STRINGS = {'GUIFRAME_WIDTH':CURRENT.GUIFRAME_WIDTH, … … 45 46 'CLEANUP_PLOT':CURRENT.CLEANUP_PLOT, 46 47 'DEFAULT_PERSPECTIVE':CURRENT.DEFAULT_PERSPECTIVE, 47 'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDER} 48 'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDER, 49 'SAS_OPENCL': None} 48 50 except: 49 51 CURRENT_STRINGS = DEFAULT_STRINGS -
src/sas/sasgui/perspectives/corfunc/corfunc.py
rae9b8bf r1dc8ec9 67 67 return [] 68 68 data = plotpanel.plots[graph.selected_plottable] 69 if data.id == IQ_DATA_LABEL or data.id == IQ_EXTRAPOLATED_DATA_LABEL or data.id == TRANSFORM_LABEL :69 if data.id == IQ_DATA_LABEL or data.id == IQ_EXTRAPOLATED_DATA_LABEL or data.id == TRANSFORM_LABEL1 or data.id == TRANSFORM_LABEL3: 70 70 return [] 71 71 item = plotpanel.plots[graph.selected_plottable] … … 179 179 # Show the extrapolation as a curve instead of points 180 180 new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM 181 elif label == TRANSFORM_LABEL :181 elif label == TRANSFORM_LABEL1 or label == TRANSFORM_LABEL3: 182 182 new_plot.xaxis("{x}", 'A') 183 183 new_plot.yaxis("{\\Gamma}", '') -
src/sas/sasgui/perspectives/corfunc/corfunc_panel.py
rae9b8bf r1dc8ec9 274 274 plot_x = transform.x[np.where(transform.x <= 200)] 275 275 plot_y = transform.y[np.where(transform.x <= 200)] 276 self._manager.show_data(Data1D(plot_x, plot_y), TRANSFORM_LABEL )276 self._manager.show_data(Data1D(plot_x, plot_y), TRANSFORM_LABEL1) 277 277 # Only enable extract params button if a fourier trans. has been done 278 278 if self.transform_type == 'fourier': -
src/sas/sasgui/perspectives/corfunc/plot_labels.py
rff11b21 r1dc8ec9 4 4 5 5 GROUP_ID_TRANSFORM = r"$\Gamma(x)$" 6 TRANSFORM_LABEL = r"$\Gamma(x)$" 6 TRANSFORM_LABEL1 = r"$\Gamma1(x)$" 7 TRANSFORM_LABEL3 = r"$\Gamma3(x)$" -
src/sas/sasgui/perspectives/fitting/fitting.py
r06a4306 r73cbeec 45 45 from sas.sasgui.guiframe.gui_manager import MDIFrame 46 46 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 47 from sas.sasgui.perspectives.fitting.gpu_options import GpuOptions 47 48 48 49 from . import models … … 192 193 self.bumps_options_menu = self.menu1.FindItemById(self.id_bumps_options) 193 194 self.bumps_options_menu.Enable(True) 195 196 self.id_gpu_options_panel = wx.NewId() 197 self.menu1.Append(self.id_gpu_options_panel, "OpenCL Options", "Choose OpenCL driver or turn it off") 198 wx.EVT_MENU(owner, self.id_gpu_options_panel, self.on_gpu_options) 194 199 195 200 self.id_result_panel = wx.NewId() … … 801 806 self.result_frame.Show() 802 807 self.result_frame.Raise() 808 809 def on_gpu_options(self, event=None): 810 """ 811 Make the Fit Results panel visible. 812 """ 813 dialog = GpuOptions(None, wx.ID_ANY, "") 814 dialog.Show() 803 815 804 816 def stop_fit(self, uid): -
src/sas/sasgui/perspectives/fitting/media/plugin.rst
rca1eaeb rca6cbc1c 568 568 cube(x): 569 569 $x^3$ 570 s inc(x):570 sas_sinx_x(x): 571 571 $\sin(x)/x$, with limit $\sin(0)/0 = 1$. 572 572 powr(x, y): … … 669 669 (`link to Bessel function's code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/sas_JN.c>`_) 670 670 671 Si(x):671 sas_Si(x): 672 672 Sine integral $\text{Si}(x) = \int_0^x \tfrac{\sin t}{t}\,dt$. 673 673 … … 693 693 (`link to code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/Si.c>`_) 694 694 695 s ph_j1c(x):695 sas_3j1x_x(x): 696 696 Spherical Bessel form 697 697 $\text{sph_j1c}(x) = 3 j_1(x)/x = 3 (\sin(x) - x \cos(x))/x^3$, … … 701 701 This function uses a Taylor series for small $x$ for numerical accuracy. 702 702 703 :code:`source = ["lib/s ph_j1c.c", ...]`704 (`link to code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/s ph_j1c.c>`_)705 706 707 sas_ J1c(x):703 :code:`source = ["lib/sas_3j1x_x.c", ...]` 704 (`link to code <https://github.com/SasView/sasmodels/tree/master/sasmodels/models/lib/sas_3j1x_x.c>`_) 705 706 707 sas_2J1x_x(x): 708 708 Bessel form $\text{sas_J1c}(x) = 2 J_1(x)/x$, with a limiting value 709 709 of 1 at $x=0$, where $J_1(x)$ is the Bessel function of first kind
Note: See TracChangeset
for help on using the changeset viewer.