Changeset b9a5f0e in sasview for src/sas/perspectives
- Timestamp:
- Feb 13, 2015 4:52:52 AM (10 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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- fd5ac0d
- Parents:
- 35ec279
- Location:
- src/sas/perspectives
- Files:
-
- 30 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/sas/perspectives/calculator/calculator.py
r79492222 rb9a5f0e 81 81 slit_length_help = "Computes the slit length from the beam profile." 82 82 resolution_help = "Approximately estimates the " 83 resolution_help += "resolution of Q in 2D based on the SA NS "83 resolution_help += "resolution of Q in 2D based on the SAS " 84 84 resolution_help += "instrumental parameter values." 85 85 mass_volume_help = "Based on the chemical formula, " 86 86 mass_volume_help += "compute the mass density or the molar volume." 87 gensa ns_help = "Generic SANS"87 gensas_help = "Generic SAS" 88 88 pyconsole_help = "Python Console." 89 89 imageviewer_help = "Load an image file and display the image." … … 98 98 ("Kiessig Thickness Calculator", 99 99 kiessig_help, self.on_calculate_kiessig), 100 ("SA NS Resolution Estimator",100 ("SAS Resolution Estimator", 101 101 resolution_help, self.on_calculate_resoltuion), 102 102 ("Generic Scattering Calculator", 103 gensa ns_help, self.on_gen_model),103 gensas_help, self.on_gen_model), 104 104 ("Python Shell/Editor", pyconsole_help, self.on_python_console), 105 105 ("Image Viewer", imageviewer_help, self.on_image_viewer),] -
src/sas/perspectives/calculator/data_operator.py
r79492222 rb9a5f0e 600 600 self.output.name = name 601 601 self.output.run = "Data Operation" 602 self.output.instrument = "Sa nsView"602 self.output.instrument = "SasView" 603 603 self.output.id = str(name) + str(time.time()) 604 604 data = {self.output.id :self.output} -
src/sas/perspectives/calculator/gen_scatter_panel.py
r79492222 rb9a5f0e 29 29 from sas.guiframe.utils import format_number 30 30 from sas.guiframe.events import StatusEvent 31 from sas.calculator import sa ns_gen31 from sas.calculator import sas_gen 32 32 from sas.perspectives.calculator.calculator_widgets import OutputTextCtrl 33 33 from sas.perspectives.calculator.calculator_widgets import InputTextCtrl … … 116 116 """ 117 117 ## Internal nickname for the window, used by the AUI manager 118 window_name = "Generic SA NS Calculator"118 window_name = "Generic SAS Calculator" 119 119 ## Name to appear on the window title bar 120 window_caption = "Generic SA NS "120 window_caption = "Generic SAS " 121 121 ## Flag to tell the AUI manager to put this panel in the center pane 122 122 CENTER_PANE = True … … 133 133 self.reader = None 134 134 self.ext = None 135 self.id = 'GenSA NS'135 self.id = 'GenSAS' 136 136 self.file_name = '' 137 137 self.time_text = None 138 138 self.orient_combo = None 139 self.omfreader = sa ns_gen.OMFReader()140 self.sldreader = sa ns_gen.SLDReader()141 self.pdbreader = sa ns_gen.PDBReader()142 self.model = sa ns_gen.GenSAS()139 self.omfreader = sas_gen.OMFReader() 140 self.sldreader = sas_gen.SLDReader() 141 self.pdbreader = sas_gen.PDBReader() 142 self.model = sas_gen.GenSAS() 143 143 self.param_dic = self.model.params 144 144 self.parameters = [] … … 451 451 """ 452 452 sld_n_default = 6.97e-06 453 omfdata = sa ns_gen.OMFData()454 omf2sld = sa ns_gen.OMF2SLD()453 omfdata = sas_gen.OMFData() 454 omf2sld = sas_gen.OMF2SLD() 455 455 omf2sld.set_data(omfdata, self.default_shape) 456 456 self.sld_data = omf2sld.output … … 538 538 if self.parent.parent is None: 539 539 return 540 msg = "Generic SA NS Calculator: %s" % (sys.exc_value)540 msg = "Generic SAS Calculator: %s" % (sys.exc_value) 541 541 wx.PostEvent(self.parent.parent, 542 542 StatusEvent(status=msg, type='stop')) … … 572 572 self.is_avg = False 573 573 if self.ext in self.omfreader.ext: 574 gen = sa ns_gen.OMF2SLD()574 gen = sas_gen.OMF2SLD() 575 575 gen.set_data(data) 576 576 #omf_data = data … … 591 591 raise 592 592 msg = "Loading Error: This file format is not supported " 593 msg += "for GenSA NS."593 msg += "for GenSAS." 594 594 wx.PostEvent(self.parent.parent, 595 595 StatusEvent(status=msg, type='stop', info='Error')) … … 684 684 graph_title = self._sld_plot_helper(ax, output, has_arrow) 685 685 # Use y, z axes (in mpl 3d) as z, y axes 686 # that consistent with our SA NS detector coords.686 # that consistent with our SAS detector coords. 687 687 ax.set_xlabel('x ($\A%s$)'% output.pos_unit) 688 688 ax.set_ylabel('z ($\A%s$)'% output.pos_unit) … … 1210 1210 # Object that receive status event 1211 1211 self.parent = parent 1212 self.sld_data = sa ns_gen.MagSLD([0], [0], [0])1212 self.sld_data = sas_gen.MagSLD([0], [0], [0]) 1213 1213 self.sld_ctl = None 1214 1214 self.default_shape = 'rectangular' … … 1277 1277 """ 1278 1278 """ 1279 omfdata = sa ns_gen.OMFData()1279 omfdata = sas_gen.OMFData() 1280 1280 sets = {} 1281 1281 try: … … 1298 1298 exec "omfdata.%s = sets['%s']"% (key, key) 1299 1299 1300 omf2sld = sa ns_gen.OMF2SLD()1300 omf2sld = sas_gen.OMF2SLD() 1301 1301 omf2sld.set_data(omfdata, self.default_shape) 1302 1302 self.sld_data = omf2sld.output … … 1628 1628 self.parent.set_main_panel_sld_data(self.sld_data) 1629 1629 1630 reader = sa ns_gen.SLDReader()1630 reader = sas_gen.SLDReader() 1631 1631 extension = '*.sld' 1632 1632 path = None … … 1810 1810 self.panel = SasGenPanel(parent=self) 1811 1811 self.data = None 1812 self.omfdata = sa ns_gen.OMFData()1812 self.omfdata = sas_gen.OMFData() 1813 1813 self.sld_data = None 1814 1814 self._default_save_location = os.getcwd() … … 2117 2117 2118 2118 media = calmedia.get_data_path(media='media') 2119 path = os.path.join(media,"gen_sa ns_help.html")2119 path = os.path.join(media,"gen_sas_help.html") 2120 2120 name = "Generic Scattering Calculator" 2121 2121 frame = HelpWindow(self, -1, 2122 title=' Help: GenSA NS',2122 title=' Help: GenSAS', 2123 2123 pageToOpen=path, size=(865, 450)) 2124 2124 try: -
src/sas/perspectives/calculator/help_panel.py
r79492222 rb9a5f0e 55 55 if pageToOpen != None: 56 56 path = os.path.dirname(pageToOpen) 57 self.path = os.path.join(path, "gen_sa ns_help.html")57 self.path = os.path.join(path, "gen_sas_help.html") 58 58 else: 59 59 self.path = calculator.get_data_path(media='media') … … 80 80 <li><a href ="resolution_calculator_help.html" 81 81 target ="showframe">Resolution Estimator</a><br></li> 82 <li><a href ="gen_sa ns_help.html"82 <li><a href ="gen_sas_help.html" 83 83 target ="showframe">Generic Scattering Calculator</a><br></li> 84 84 <li><a href ="pycrust_help.html" -
src/sas/perspectives/calculator/kiessig_calculator_panel.py
r79492222 rb9a5f0e 114 114 hint_msg += "the thickness of a layer" 115 115 hint_msg += " or the diameter of particles\n " 116 hint_msg += "from the Kiessig fringe width in SA NS/NR data."116 hint_msg += "from the Kiessig fringe width in SAS/NR data." 117 117 hint_msg += "" 118 118 self.hint_txt = wx.StaticText(self, -1, hint_msg) -
src/sas/perspectives/calculator/media/data_operator_help.html
r79492222 rb9a5f0e 23 23 4) If the operation is successful, hit the Apply button to make the new data. 24 24 Then the data name will be shown up in the data box in the data explorer.<br> 25 Note: The errors and warnings will be displayed at the bottom of the Sa nsView window.25 Note: The errors and warnings will be displayed at the bottom of the SasView window. 26 26 </p> 27 27 <p> -
src/sas/perspectives/calculator/media/kiessig_calculator_help.html
r79492222 rb9a5f0e 11 11 This tool is to approximately estimate the thickness of a layer 12 12 or the diameter of particles from the Kiessig fringe in 13 SA NS/NR data, and uses the Kiessig relation;13 SAS/NR data, and uses the Kiessig relation; 14 14 thickness = 2*Pi/fringe_width. 15 15 -
src/sas/perspectives/calculator/media/resolution_calculator_help.html
r79492222 rb9a5f0e 1 1 <html> 2 2 <body> 3 <h4>SA NS Q Resolution Estimator</h4>3 <h4>SAS Q Resolution Estimator</h4> 4 4 <ul> 5 5 <li><a href="#Description">Description</a></li> … … 11 11 <p> 12 12 This tool is to approximately estimate the resolution of Q based on the 13 SA NS instrumental parameter values assuming that the detector is flat13 SAS instrumental parameter values assuming that the detector is flat 14 14 and vertical to the incident beam direction. 15 15 </p> … … 52 52 the variance is slightly under estimated.</p> 53 53 <p>7. The summary can be accessed by clicking the 'light-bulb' icon 54 at the bottom of the Sa nsView main window.54 at the bottom of the SasView main window. 55 55 </p> 56 56 <p><img src="resolution_tutor.gif"> -
src/sas/perspectives/calculator/media/slit_calculator_help.html
r79492222 rb9a5f0e 27 27 28 28 <p> 29 To see the file format, check the file, 'beam profile.DAT', in the 'test' folder of Sa nsView.29 To see the file format, check the file, 'beam profile.DAT', in the 'test' folder of SasView. 30 30 </p> 31 31 </body> -
src/sas/perspectives/calculator/resolution_calculator_panel.py
r79492222 rb9a5f0e 58 58 """ 59 59 ## Internal nickname for the window, used by the AUI manager 60 window_name = "SA NS Resolution Estimator"60 window_name = "SAS Resolution Estimator" 61 61 ## Name to appear on the window title bar 62 62 window_caption = "" … … 1397 1397 """ 1398 1398 def __init__(self, parent = None, manager=None, 1399 title = "SA NS Resolution Estimator",1399 title = "SAS Resolution Estimator", 1400 1400 size=(PANEL_WIDTH * 2, PANEL_HEIGHT), *args, **kwds): 1401 1401 kwds['title'] = title -
src/sas/perspectives/fitting/basepage.py
r79492222 rb9a5f0e 2015 2015 temp_smear = self.current_smearer 2016 2016 # compute weight for the current data 2017 from sas import get_weight2017 from sas.perspectives.fitting.utils import get_weight 2018 2018 flag = self.get_weight_flag() 2019 2019 weight = get_weight(data=self.data, is2d=self._is_2D(), flag=flag) … … 3136 3136 """ 3137 3137 from help_panel import HelpWindow 3138 import sas.models as models3138 import sas.models as models 3139 3139 3140 3140 # Get models help model_function path … … 3173 3173 Get the string copies of the param names and values in the tap 3174 3174 """ 3175 content = 'sa nsview_parameter_values:'3175 content = 'sasview_parameter_values:' 3176 3176 # Do it if params exist 3177 3177 if self.parameters != []: … … 3402 3402 # put the text into dictionary 3403 3403 lines = text.split(':') 3404 if lines[0] != 'sa nsview_parameter_values':3404 if lines[0] != 'sasview_parameter_values': 3405 3405 self._copy_info(False) 3406 3406 return False -
src/sas/perspectives/fitting/console.py
r79492222 rb9a5f0e 147 147 d_flag = (hasattr(self.result, "data") and \ 148 148 self.result.data is not None and \ 149 hasattr(self.result.data, "sa ns_data") and150 self.result.data.sa ns_data is not None)149 hasattr(self.result.data, "sas_data") and 150 self.result.data.sas_data is not None) 151 151 m_flag = (hasattr(self.result, "model") and \ 152 152 self.result.model is not None) 153 153 if d_flag: 154 data_name = self.result.data.sa ns_data.name154 data_name = self.result.data.sas_data.name 155 155 if m_flag: 156 156 model_name = str(self.result.model.name) -
src/sas/perspectives/fitting/fitpage.py
r79492222 rb9a5f0e 608 608 model_disp = wx.StaticText(self, -1, 'Function') 609 609 CHECK_STATE = self.cb1.GetValue() 610 import sas.models.dispersion_models610 import sas.models.dispersion_models 611 611 self.polydisp = sas.models.dispersion_models.models 612 612 … … 2175 2175 """ 2176 2176 # compute weight for the current data 2177 from sas import get_weight2177 from sas.perspectives.fitting.utils import get_weight 2178 2178 flag_weight = self.get_weight_flag() 2179 2179 if is_2D == None: -
src/sas/perspectives/fitting/fitting.py
r79492222 rb9a5f0e 33 33 from sas.guiframe.data_processor import BatchCell 34 34 from sas.fit.Fitting import Fit 35 from sas import ConsoleUpdate36 from sas import FitProblemDictionary37 from sas import FitPanel38 from sas import ResultPanel, PlotResultEvent39 40 from sas import FitThread41 from sas import Reader42 from sas import Chi2UpdateEvent35 from sas.perspectives.fitting.console import ConsoleUpdate 36 from sas.perspectives.fitting.fitproblem import FitProblemDictionary 37 from sas.perspectives.fitting.fitpanel import FitPanel 38 from sas.perspectives.fitting.resultpanel import ResultPanel, PlotResultEvent 39 40 from sas.perspectives.fitting.fit_thread import FitThread 41 from sas.perspectives.fitting.pagestate import Reader 42 from sas.perspectives.fitting.fitpage import Chi2UpdateEvent 43 43 from sas.perspectives.calculator.model_editor import TextDialog 44 44 from sas.perspectives.calculator.model_editor import EditorWindow -
src/sas/perspectives/fitting/ftol_dialog.py
r79492222 rb9a5f0e 17 17 # default ftol 18 18 F_TOL = 1.49012e-08 19 SA NS_F_TOL = 5e-0519 SAS_F_TOL = 5e-05 20 20 21 21 PANEL_WIDTH = 270 … … 38 38 vbox = wx.BoxSizer(wx.VERTICAL) 39 39 title_text = wx.StaticText(self, id=wx.NewId(), label='FTol selection (Leastsq)') 40 self.default_bt = wx.RadioButton(self, -1, 'Sa nsView Default (5e-05)', (15, 30), style=wx.RB_GROUP)40 self.default_bt = wx.RadioButton(self, -1, 'SasView Default (5e-05)', (15, 30), style=wx.RB_GROUP) 41 41 self.default_bt.SetValue(True) 42 42 self.default_bt.Bind(wx.EVT_RADIOBUTTON, self.OnFtolSelection) … … 88 88 """ 89 89 if self.default_bt.GetValue(): 90 return SA NS_F_TOL90 return SAS_F_TOL 91 91 elif self.sci_default_bt.GetValue(): 92 92 return F_TOL … … 102 102 except: 103 103 return None 104 return SA NS_F_TOL104 return SAS_F_TOL -
src/sas/perspectives/fitting/media/category_manager_help.html
r79492222 rb9a5f0e 9 9 <p> 10 10 11 Our SA NS models are, by default, classified into 5 categories; shapes, shape-independent,11 Our SAS models are, by default, classified into 5 categories; shapes, shape-independent, 12 12 structure factor, and customized models, where these categories (except the customized models) can be reassigned, added, and removed using 'Category Manager'. 13 13 Each models can also be enabled(shown)/disabled(hidden) from the category that they -
src/sas/perspectives/fitting/media/model_use_help.html
r79492222 rb9a5f0e 31 31 See 'Custom model editor' in the side menu on left. 32 32 Advanced users can write your own model and save it (in .py format) into <b>plugin_models</b> directory 33 in .sa nsview of your home directory (eg., username\.sansview>\plugin_models). You plugin33 in .sasview of your home directory (eg., username\.sasview>\plugin_models). You plugin 34 34 model will be added into "<>Customized Models</>" on the next model selection. 35 35 </p> -
src/sas/perspectives/fitting/models.py
r79492222 rb9a5f0e 159 159 dir = find_plugins_dir() 160 160 if not os.path.isdir(dir): 161 msg = "Sa nsView couldn't locate Model plugin folder."161 msg = "SasView couldn't locate Model plugin folder." 162 162 msg += """ "%s" does not exist""" % dir 163 163 logging.warning(msg) -
src/sas/perspectives/fitting/pagestate.py
r79492222 rb9a5f0e 973 973 ## Wildcards 974 974 type = ["Fitting files (*.fitv)|*.fitv" 975 "SA NSView file (*.svs)|*.svs"]975 "SASView file (*.svs)|*.svs"] 976 976 ## List of allowed extensions 977 977 ext = ['.fitv', '.FITV', '.svs', 'SVS'] -
src/sas/perspectives/fitting/plugin_models/polynomial5.py
r79492222 rb9a5f0e 11 11 Please select the 'Compile' from the menubar after the modification and saving. 12 12 Note that we recommend to save the file as a different file name. 13 Otherwise, it could be removed in the future on re-installation of the Sa nsView.13 Otherwise, it could be removed in the future on re-installation of the SasView. 14 14 ## ***************************************************************************** 15 15 """ -
src/sas/perspectives/fitting/plugin_models/sph_bessel_jn.py
r79492222 rb9a5f0e 11 11 Please select the 'Compile' from the menubar after the modification and saving. 12 12 Note that we recommend to save the file as a different file name. 13 Otherwise, it could be removed in the future on re-installation of the Sa nsView.13 Otherwise, it could be removed in the future on re-installation of the SasView. 14 14 ## ***************************************************************************** 15 15 """ -
src/sas/perspectives/fitting/plugin_models/sum_Ap1_1_Ap2.py
r79492222 rb9a5f0e 8 8 Please select the 'Compile' from the menubar after the modification and saving. 9 9 Note that we recommend to save the file as a different file name. 10 Otherwise, it could be removed in the future on re-installation of the Sa nsView.10 Otherwise, it could be removed in the future on re-installation of the SasView. 11 11 ## ***************************************************************************** 12 12 """ -
src/sas/perspectives/fitting/plugin_models/sum_p1_p2.py
r79492222 rb9a5f0e 8 8 Please select the 'Compile' from the menubar after the modification and saving. 9 9 Note that we recommend to save the file as a different file name. 10 Otherwise, it could be removed in the future on re-installation of the Sa nsView.10 Otherwise, it could be removed in the future on re-installation of the SasView. 11 11 ## ***************************************************************************** 12 12 """ -
src/sas/perspectives/fitting/plugin_models/testmodel.py
r79492222 rb9a5f0e 11 11 Please select the 'Compile' from the menubar after the modification and saving. 12 12 Note that we recommend to save the file as a different file name. 13 Otherwise, it could be removed in the future on re-installation of the Sa nsView.13 Otherwise, it could be removed in the future on re-installation of the SasView. 14 14 ## ***************************************************************************** 15 15 """ -
src/sas/perspectives/fitting/plugin_models/testmodel_2.py
r79492222 rb9a5f0e 11 11 Please select the 'Compile' from the menubar after the modification and saving. 12 12 Note that we recommend to save the file as a different file name. 13 Otherwise, it could be removed in the future on re-installation of the Sa nsView.13 Otherwise, it could be removed in the future on re-installation of the SasView. 14 14 ## ***************************************************************************** 15 15 """ -
src/sas/perspectives/invariant/help_panel.py
r79492222 rb9a5f0e 82 82 self.rhelp = html.HtmlWindow(rpanel, -1, style=wx.NO_BORDER, 83 83 size=(500, -1)) 84 import sas.perspectives.invariant as invariant84 import sas.perspectives.invariant as invariant 85 85 path = invariant.get_data_path(media='media') 86 86 self.path = os.path.join(path,"invariant_help.html") -
src/sas/perspectives/invariant/invariant.py
r79492222 rb9a5f0e 22 22 from sas.guiframe.events import StatusEvent 23 23 from sas.guiframe.gui_style import GUIFRAME_ID 24 from sas import Reader as reader24 from sas.perspectives.invariant.invariant_state import Reader as reader 25 25 from sas.dataloader.loader import Loader 26 from sas import InvariantPanel26 from sas.perspectives.invariant.invariant_panel import InvariantPanel 27 27 from sas.guiframe.plugin_base import PluginBase 28 28 -
src/sas/perspectives/invariant/invariant_panel.py
r79492222 rb9a5f0e 14 14 from sas.guiframe.events import StatusEvent 15 15 from sas.guiframe.events import AppendBookmarkEvent 16 from sas import InvariantDetailsPanel17 from sas import InvariantContainer18 from sas import OutputTextCtrl19 from sas import InvTextCtrl20 from sas import InvariantState as IState16 from sas.perspectives.invariant.invariant_details import InvariantDetailsPanel 17 from sas.perspectives.invariant.invariant_details import InvariantContainer 18 from sas.perspectives.invariant.invariant_widgets import OutputTextCtrl 19 from sas.perspectives.invariant.invariant_widgets import InvTextCtrl 20 from sas.perspectives.invariant.invariant_state import InvariantState as IState 21 21 from sas.guiframe.panel_base import PanelBase 22 22 # The minimum q-value to be used when extrapolating … … 766 766 : param event: report button event 767 767 """ 768 from sas import ReportDialog768 from sas.perspectives.invariant.report_dialog import ReportDialog 769 769 770 770 self.state.set_report_string() … … 1914 1914 self.loader = Loader() 1915 1915 import invariant 1916 path = "C:/ECLPS/workspace/trunk/sa nsdataloader/test/ascii_test_3.txt"1916 path = "C:/ECLPS/workspace/trunk/sasdataloader/test/ascii_test_3.txt" 1917 1917 data = self.loader.load(path) 1918 1918 self.panel = InvariantPanel(self) -
src/sas/perspectives/invariant/invariant_state.py
r79492222 rb9a5f0e 106 106 self.wximbmp = None 107 107 # report_html strings 108 import sas.perspectives.invariant as invariant108 import sas.perspectives.invariant as invariant 109 109 path = invariant.get_data_path(media='media') 110 110 path_report_html = os.path.join(path,"report_template.html") … … 643 643 ## Wildcards 644 644 type = ["Invariant file (*.inv)|*.inv", 645 "SA NSView file (*.svs)|*.svs"]645 "SASView file (*.svs)|*.svs"] 646 646 ## List of allowed extensions 647 647 ext = ['.inv', '.INV', '.svs', 'SVS'] -
src/sas/perspectives/pr/inversion_state.py
r79492222 rb9a5f0e 359 359 ## Wildcards 360 360 type = ["P(r) files (*.prv)|*.prv", 361 "SA NSView files (*.svs)|*.svs"]361 "SASView files (*.svs)|*.svs"] 362 362 ## List of allowed extensions 363 363 ext = ['.prv', '.PRV', '.svs', '.SVS']
Note: See TracChangeset
for help on using the changeset viewer.