Changeset 51a4d78 in sasview for src/sas/sasgui/guiframe


Ignore:
Timestamp:
Oct 8, 2016 1:33:04 PM (7 years ago)
Author:
jhbakker
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:
1fac6c0
Parents:
7988501 (diff), f7bc948 (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.
Message:

Merge branch 'ajj_sesans' into Jurrian1D

Location:
src/sas/sasgui/guiframe
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/CategoryInstaller.py

    r50008e3 r212bfc2  
    1111import os 
    1212import sys 
    13 import shutil 
    1413import json 
    15 from collections import defaultdict 
     14import logging 
     15from collections import defaultdict, OrderedDict 
    1616 
    1717USER_FILE = 'categories.json' 
     
    2323    Note - class is entirely static! 
    2424    """ 
    25  
    2625 
    2726    def __init__(self): 
     
    4342        import sas.sasgui.perspectives.fitting.models 
    4443        return sas.sasgui.perspectives.fitting.models.get_model_python_path() 
    45      
     44 
    4645    @staticmethod 
    4746    def _get_default_cat_file_dir(): 
     
    5453        import sas.sasview 
    5554        cat_file = "default_categories.json" 
    56          
     55 
    5756        possible_cat_file_paths = [ 
    5857            os.path.join(os.path.split(sas.sasview.__file__)[0], cat_file),           # Source 
     
    6463            if os.path.isfile(path): 
    6564                return os.path.dirname(path) 
    66              
     65 
    6766        raise RuntimeError('CategoryInstaller: Could not find folder containing default categories') 
    6867 
     
    8988                by_model_dict[model].append(category) 
    9089                model_enabled_dict[model] = enabled 
    91      
     90 
    9291        return (by_model_dict, model_enabled_dict) 
    93  
    9492 
    9593    @staticmethod 
     
    105103                master_category_dict[category].append(\ 
    106104                    (model, model_enabled_dict[model])) 
    107          
    108         return master_category_dict 
     105        return OrderedDict(sorted(master_category_dict.items(), key=lambda t: t[0])) 
    109106 
    110107    @staticmethod 
     
    113110        returns the user data file, eg .sasview/categories.json.json 
    114111        """ 
    115         return os.path.join(CategoryInstaller._get_home_dir(), 
    116                             USER_FILE) 
     112        return os.path.join(CategoryInstaller._get_home_dir(), USER_FILE) 
    117113 
    118114    @staticmethod 
    119115    def get_default_file(): 
    120         """ 
    121         returns the path of the default file 
    122         e.g. blahblah/default_categories.json 
    123         """ 
    124         return os.path.join(\ 
    125             CategoryInstaller._get_default_cat_file_dir(), "default_categories.json") 
    126          
     116        logging.warning("CategoryInstaller.get_default_file is deprecated.") 
     117 
    127118    @staticmethod 
    128119    def check_install(homedir = None, model_list=None): 
     
    134125        :param model_list: List of model names except customized models 
    135126        """ 
    136         #model_list = [] 
    137         default_file = CategoryInstaller.get_default_file() 
     127        _model_dict = { model.name: model for model in model_list} 
     128        _model_list = _model_dict.keys() 
     129 
    138130        serialized_file = None 
    139         master_category_dict = defaultdict(list) 
    140131        if homedir == None: 
    141132            serialized_file = CategoryInstaller.get_user_file() 
     
    143134            serialized_file = os.path.join(homedir, USER_FILE) 
    144135        if os.path.isfile(serialized_file): 
    145             cat_file = open(serialized_file, 'rb') 
     136            with open(serialized_file, 'rb') as f: 
     137                master_category_dict = json.load(f) 
    146138        else: 
    147             cat_file = open(default_file, 'rb') 
    148         master_category_dict = json.load(cat_file) 
    149 #        master_category_dict = pickle.Unpickler(cat_file).load() 
     139            master_category_dict = defaultdict(list) 
     140 
    150141        (by_model_dict, model_enabled_dict) = \ 
    151142                CategoryInstaller._regenerate_model_dict(master_category_dict) 
    152         cat_file.close() 
    153         add_list = model_list 
     143        add_list = _model_list 
    154144        del_name = False 
    155145        for cat in master_category_dict.keys(): 
    156146            for ind in range(len(master_category_dict[cat])): 
    157147                model_name, enabled = master_category_dict[cat][ind] 
    158                 if model_name not in model_list: 
     148                if model_name not in _model_list: 
    159149                    del_name = True  
    160150                    try: 
     
    162152                        model_enabled_dict.pop(model_name) 
    163153                    except: 
    164                         pass 
     154                        logging.error("CategoryInstaller: %s", sys.exc_value) 
    165155                else: 
    166156                    add_list.remove(model_name) 
     
    168158            for model in add_list: 
    169159                model_enabled_dict[model]= True 
    170                 by_model_dict[model].append('Uncategorized') 
    171      
     160                if _model_dict[model].category is None or len(str(_model_dict[model].category.capitalize())) == 0: 
     161                    by_model_dict[model].append('Uncategorized') 
     162                else: 
     163                    category = _model_dict[model].category 
     164                    toks = category.split(':') 
     165                    category = toks[-1] 
     166                    toks = category.split('-') 
     167                    capitalized_words = [t.capitalize() for t in toks] 
     168                    category = ' '.join(capitalized_words) 
     169 
     170                    by_model_dict[model].append(category) 
     171 
    172172            master_category_dict = \ 
    173173                CategoryInstaller._regenerate_master_dict(by_model_dict, 
    174174                                                          model_enabled_dict) 
    175              
    176             json.dump( master_category_dict, 
    177                          open(serialized_file, 'wb') ) 
     175 
     176            json.dump(master_category_dict, open(serialized_file, 'wb')) 
  • src/sas/sasgui/guiframe/CategoryManager.py

    r80b1df3 r212bfc2  
    1313import sys 
    1414import os 
     15import logging 
    1516from wx.lib.mixins.listctrl import CheckListCtrlMixin, ListCtrlAutoWidthMixin 
    1617from collections import defaultdict 
     
    366367        """ 
    367368        try: 
    368             file = CategoryInstaller.get_user_file() 
    369             if os.path.isfile(file): 
    370                 cat_file = open(file, 'rb') 
    371 #               self.master_category_dict = pickle.load(cat_file) 
    372                 self.master_category_dict = json.load(cat_file) 
    373             else: 
    374                 cat_file = open(CategoryInstaller.get_default_file(), 'rb') 
    375 #                       self.master_category_dict = pickle.load(cat_file) 
    376                 self.master_category_dict = json.load(cat_file) 
    377             cat_file.close() 
     369            cat_file = CategoryInstaller.get_user_file() 
     370            self.master_category_dict = {} 
     371            if os.path.isfile(cat_file): 
     372                with open(cat_file, 'rb') as f: 
     373                    self.master_category_dict = json.load(f) 
    378374        except IOError: 
    379             print 'Problem reading in category file. Please review' 
    380  
     375            logging.error('Problem reading in category file.') 
    381376 
    382377        self._regenerate_model_dict() 
  • src/sas/sasgui/guiframe/customdir.py

    rd85c194 r212bfc2  
    11# Setup and find Custom config dir 
    2 import sys 
    32import os.path 
    43import shutil 
    5 from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 
    64 
    75CONF_DIR = 'config'  
     
    1210    Find and return user/.sasview dir 
    1311    """ 
    14     dir = os.path.join(os.path.expanduser("~"),  
    15                        ("." + APPLICATION_NAME)) 
    16     return dir 
     12    return os.path.join(os.path.expanduser("~"), ("." + APPLICATION_NAME)) 
    1713 
    1814def _find_customconf_dir(): 
     
    2218    """ 
    2319    u_dir = _find_usersasview_dir() 
    24     dir = os.path.join(u_dir, CONF_DIR) 
    25      
    26     return dir 
     20    return os.path.join(u_dir, CONF_DIR) 
    2721 
    2822def _setup_conf_dir(path): 
     
    3024    Setup the custom config dir and cat file 
    3125    """ 
    32     dir = _find_customconf_dir() 
     26    conf_dir = _find_customconf_dir() 
    3327    # If the plugin directory doesn't exist, create it 
    34     if not os.path.isdir(dir): 
    35         os.makedirs(dir) 
    36     file = os.path.join(dir, "custom_config.py") 
    37     cat_file = CategoryInstaller.get_user_file() 
    38     # If the user category file doesn't exist copy the default to 
    39     # the user directory 
    40     if not os.path.isfile(cat_file): 
    41         try: 
    42             default_cat_file = CategoryInstaller.get_default_file() 
    43             if os.path.isfile(default_cat_file): 
    44                 shutil.copyfile(default_cat_file, cat_file) 
    45             else: 
    46                 print "Unable to find/copy default cat file" 
    47         except: 
    48             print "Unable to copy default cat file to the user dir." 
     28    if not os.path.isdir(conf_dir): 
     29        os.makedirs(conf_dir) 
     30    config_file = os.path.join(conf_dir, "custom_config.py") 
    4931 
    5032    # Place example user models as needed 
    5133    try: 
    52         if not os.path.isfile(file): 
    53          shutil.copyfile(os.path.join(path, "custom_config.py"), file) 
     34        if not os.path.isfile(config_file): 
     35            shutil.copyfile(os.path.join(path, "custom_config.py"), config_file) 
    5436    except: 
    5537        # Check for data path next to exe/zip file. 
     
    6345            temp_path = os.path.join(f_dir, "custom_config.py") 
    6446            if os.path.isfile(temp_path): 
    65                 shutil.copyfile(temp_path, file) 
     47                shutil.copyfile(temp_path, config_file) 
    6648                is_dir = True 
    6749                break 
    6850        if not is_dir: 
    6951            raise 
    70          
    71     return dir 
    72    
    73          
     52    return conf_dir 
     53 
     54 
    7455class SetupCustom(object): 
    7556    """ 
     
    8162    def setup_dir(self, path): 
    8263        return _setup_conf_dir(path) 
    83      
    84  
    85      
    86      
    87    
  • src/sas/sasgui/guiframe/dataFitting.py

    r7988501 r51a4d78  
    378378        _str = "%s\n" % LoadData2D.__str__(self) 
    379379        return _str  
    380      
    381     def _validity_check(self, other): 
    382         """ 
    383         Checks that the data lengths are compatible. 
    384         Checks that the x vectors are compatible. 
    385         Returns errors vectors equal to original 
    386         errors vectors if they were present or vectors 
    387         of zeros when none was found. 
    388          
    389         :param other: other data set for operation 
    390          
    391         :return: dy for self, dy for other [numpy arrays] 
    392          
    393         :raise ValueError: when lengths are not compatible 
    394          
    395         """ 
    396         err_other = None 
    397         if isinstance(other, Data2D): 
    398             # Check that data lengths are the same 
    399             if len(self.data) != len(other.data) or \ 
    400                 len(self.qx_data) != len(other.qx_data) or \ 
    401                 len(self.qy_data) != len(other.qy_data): 
    402                 msg = "Unable to perform operation: data length are not equal" 
    403                 raise ValueError, msg 
    404             #if len(self.data) < 1: 
    405             #    msg = "Incompatible data sets: I-values do not match" 
    406             #    raise ValueError, msg  
    407             for ind in range(len(self.data)): 
    408                 if self.qx_data[ind] != other.qx_data[ind]: 
    409                     msg = "Incompatible data sets: qx-values do not match" 
    410                     raise ValueError, msg 
    411                 if self.qy_data[ind] != other.qy_data[ind]: 
    412                     msg = "Incompatible data sets: qy-values do not match" 
    413                     raise ValueError, msg 
    414                     
    415             # Check that the scales match 
    416             err_other = other.err_data 
    417             if other.err_data == None or \ 
    418                 (len(other.err_data) != len(other.data)): 
    419                 err_other = numpy.zeros(len(other.data)) 
    420              
    421         # Check that we have errors, otherwise create zero vector 
    422         err = self.err_data 
    423         if self.err_data == None or \ 
    424             (len(self.err_data) != len(self.data)): 
    425             err = numpy.zeros(len(other.data)) 
    426              
    427         return err, err_other 
    428  
    429     def _validity_check_union(self, other): 
    430         """ 
    431         Checks that the data lengths are compatible. 
    432         Checks that the x vectors are compatible. 
    433         Returns errors vectors equal to original 
    434         errors vectors if they were present or vectors 
    435         of zeros when none was found. 
    436          
    437         :param other: other data set for operation 
    438          
    439         :return: bool 
    440          
    441         :raise ValueError: when data types are not compatible 
    442          
    443         """ 
    444         if not isinstance(other, Data2D): 
    445             msg = "Unable to perform operation: different types of data set" 
    446             raise ValueError, msg    
    447         return True 
    448      
     380 
    449381    def _perform_operation(self, other, operation): 
    450382        """ 
  • src/sas/sasgui/guiframe/data_panel.py

    re767897 r998ca90  
    890890 
    891891 
    892     def on_remove(self, event): 
     892    def on_remove(self, event, msg=""): 
    893893        """ 
    894894        Get a list of item checked and remove them from the treectrl 
    895895        Ask the parent to remove reference to this item 
    896896        """ 
    897         msg = "This operation will delete the data sets checked " 
    898         msg += "and all the dependents." 
     897        if msg == "": 
     898            msg = "This operation will delete the data sets checked " 
     899            msg += "and all the dependents." 
    899900        msg_box = wx.MessageDialog(None, msg, 'Warning', wx.OK|wx.CANCEL) 
    900901        if msg_box.ShowModal() != wx.ID_OK: 
    901             return 
     902            return True 
    902903 
    903904        data_to_remove, theory_to_remove, _ = self.set_data_helper() 
  • src/sas/sasgui/guiframe/gui_manager.py

    r3fac0df ra4c2445  
    677677        update edit menu if available 
    678678        """ 
    679         if event != None: 
     679        if event is not None: 
    680680            self.panel_on_focus = event.panel 
    681681        if self.panel_on_focus is not None: 
    682             #Disable save application if the current panel is in batch mode 
    683             flag = self.panel_on_focus.get_save_flag() 
    684             if self._save_appl_menu != None: 
    685                 self._save_appl_menu.Enable(flag) 
    686  
    687             if self.panel_on_focus not in self.plot_panels.values(): 
    688                 for ID in self.panels.keys(): 
    689                     if self.panel_on_focus != self.panels[ID]: 
    690                         self.panels[ID].on_kill_focus(None) 
    691  
    692             if self._data_panel is not None and \ 
    693                             self.panel_on_focus is not None: 
    694                 self.set_panel_on_focus_helper() 
    695                 #update toolbar 
    696                 self._update_toolbar_helper() 
    697                 #update edit menu 
    698                 self.enable_edit_menu() 
     682            # Disable save application if the current panel is in batch mode 
     683            try: 
     684                flag = self.panel_on_focus.get_save_flag() 
     685                if self._save_appl_menu != None: 
     686                    self._save_appl_menu.Enable(flag) 
     687 
     688                if self.panel_on_focus not in self.plot_panels.values(): 
     689                    for ID in self.panels.keys(): 
     690                        if self.panel_on_focus != self.panels[ID]: 
     691                            self.panels[ID].on_kill_focus(None) 
     692 
     693                if self._data_panel is not None and \ 
     694                                self.panel_on_focus is not None: 
     695                    self.set_panel_on_focus_helper() 
     696                    #update toolbar 
     697                    self._update_toolbar_helper() 
     698                    #update edit menu 
     699                    self.enable_edit_menu() 
     700            except wx._core.PyDeadObjectError: 
     701                pass 
    699702 
    700703    def disable_app_menu(self, p_panel=None): 
     
    11521155                self.delete_panel(ID) 
    11531156                break 
    1154         self.cpanel_on_focus.SetFocus() 
     1157        if self.cpanel_on_focus is not None: 
     1158            self.cpanel_on_focus.SetFocus() 
    11551159 
    11561160 
     
    13331337                    self._applications_menu_name = name 
    13341338 
     1339    def _on_marketplace_click(self, event): 
     1340        """ 
     1341            Click event for the help menu item linking to the Marketplace. 
     1342        """ 
     1343        import webbrowser 
     1344        webbrowser.open_new(config.marketplace_url) 
     1345 
    13351346    def _add_help_menu(self): 
    13361347        """ 
     
    13381349        tutorial PDF and documentation pages. 
    13391350        """ 
    1340         # Help menu 
    13411351        self._help_menu = wx.Menu() 
    1342         style = self.__gui_style & GUIFRAME.WELCOME_PANEL_ON 
    13431352 
    13441353        wx_id = wx.NewId() 
    13451354        self._help_menu.Append(wx_id, '&Documentation', '') 
    13461355        wx.EVT_MENU(self, wx_id, self._onSphinxDocs) 
    1347         self._help_menu.AppendSeparator() 
    13481356 
    13491357        if config._do_tutorial and (IS_WIN or sys.platform == 'darwin'): 
     
    13511359            self._help_menu.Append(wx_id, '&Tutorial', 'Software tutorial') 
    13521360            wx.EVT_MENU(self, wx_id, self._onTutorial) 
    1353             self._help_menu.AppendSeparator() 
    1354  
    13551361 
    13561362        if config._do_acknowledge: 
     
    13581364            self._help_menu.Append(wx_id, '&Acknowledge', 'Acknowledging SasView') 
    13591365            wx.EVT_MENU(self, wx_id, self._onAcknowledge) 
    1360             self._help_menu.AppendSeparator() 
    1361  
    13621366 
    13631367        if config._do_aboutbox: 
     
    13661370            self._help_menu.Append(wx_id, '&About', 'Software information') 
    13671371            wx.EVT_MENU(self, wx_id, self._onAbout) 
    1368             self._help_menu.AppendSeparator() 
    1369  
     1372 
     1373        if config.marketplace_url: 
     1374            wx_id = wx.NewId() 
     1375            self._help_menu.Append(wx_id, '&Model marketplace', '') 
     1376            wx.EVT_MENU(self, wx_id, self._on_marketplace_click) 
    13701377 
    13711378        # Checking for updates 
     
    19001907    def _on_open_state_project(self, event): 
    19011908        """ 
     1909        Load in a .svs project file after removing all data from SasView 
    19021910        """ 
    19031911        path = None 
    19041912        if self._default_save_location == None: 
    19051913            self._default_save_location = os.getcwd() 
    1906         wx.PostEvent(self, StatusEvent(status="Loading Project file...")) 
    1907         dlg = wx.FileDialog(self, 
     1914        msg = "This operation will set remove all data, plots and analyses from" 
     1915        msg += " SasView before loading the project. Do you wish to continue?" 
     1916        self._data_panel.selection_cbox.SetValue('Select all Data') 
     1917        self._data_panel._on_selection_type(None) 
     1918        for _, theory_dict in self._data_panel.list_cb_theory.iteritems(): 
     1919            for  key, value in theory_dict.iteritems(): 
     1920                item, _, _ = value 
     1921                item.Check(True) 
     1922        if not self._data_panel.on_remove(None, msg): 
     1923            wx.PostEvent(self, StatusEvent(status="Loading Project file...")) 
     1924            dlg = wx.FileDialog(self, 
    19081925                            "Choose a file", 
    19091926                            self._default_save_location, "", 
    19101927                            APPLICATION_WLIST) 
    1911         if dlg.ShowModal() == wx.ID_OK: 
    1912             path = dlg.GetPath() 
     1928            if dlg.ShowModal() == wx.ID_OK: 
     1929                path = dlg.GetPath() 
    19131930            if path is not None: 
    19141931                self._default_save_location = os.path.dirname(path) 
    1915         dlg.Destroy() 
    1916  
    1917         self.load_state(path=path, is_project=True) 
     1932                dlg.Destroy() 
     1933                # Reset to a base state 
     1934                self._on_reset_state() 
     1935                # Load the project file 
     1936                self.load_state(path=path, is_project=True) 
     1937 
     1938    def _on_reset_state(self): 
     1939        """ 
     1940        Resets SasView to its freshly opened state. 
     1941        :return: None 
     1942        """ 
     1943        # Reset all plugins to their base state 
     1944        self._data_panel.set_panel_on_focus() 
     1945        # Remove all loaded data 
     1946        for plugin in self.plugins: 
     1947            plugin.clear_panel() 
     1948        # Reset plot number to 0 
     1949        self.graph_num = 0 
    19181950 
    19191951    def _on_save_application(self, event): 
     
    20632095            except: 
    20642096                logging.info("Failed to connect to www.sasview.org") 
    2065         self._process_version(version_info, standalone=event == None)     
    2066  
    2067          
    2068          
    2069 #          
    2070 #         try: 
    2071 #             req = urllib2.Request(config.__update_URL__) 
    2072 #             res = urllib2.urlopen(req) 
    2073 #             content = res.read().strip() 
    2074 #             logging.info("Connected to www.sasview.org. Latest version: %s" 
    2075 #                          % (content)) 
    2076 #             version_info = json.loads(content) 
    2077 #         except: 
    2078 #             logging.info("Failed to connect to www.sasview.org") 
    2079 #             version_info = {"version": "0.0.0"} 
    2080 #         self._process_version(version_info, standalone=event == None) 
     2097        self._process_version(version_info, standalone=event == None) 
    20812098 
    20822099    def _process_version(self, version_info, standalone=True): 
  • src/sas/sasgui/guiframe/media/data_formats_help.rst

    r280f929 r48b8f6d  
    1010============ 
    1111 
    12 SasView reads several different 1D (I(Q) vs Q), 2D SANS(I(Qx,Qy) vs (Qx,Qy)) 
    13 and SESANS (P(z) vs z) 
    14 data files. But please note that SasView does not at present load data where 
    15 the Q and I(Q) data are in separate files. 
     12SasView reads several different 1D SAS (*I(Q) vs Q*), 2D SAS(*I(Qx,Qy) vs (Qx,Qy)*) and 1D SESANS (*P(z) vs z*) data files. From SasView 4.1 onwards, a :ref:`File_Converter_Tool` allows some legacy formats to be converted into modern formats that SasView will read. 
    1613 
    17 1D Formats SANS 
    18 --------------- 
     141D SAS Formats 
     15-------------- 
    1916 
    20 SasView will read files with 2 to 4 columns of numbers in the following order:  
     17SasView will read ASCII ('text') files with 2 to 4 columns of numbers in the following order:  
    2118 
    22     Q, I(Q), (dI(Q), dQ(Q)) 
     19    *Q, I(Q), ( dI(Q), dQ(Q) )* 
    2320     
    24 where dQ(Q) is the instrumental resolution in Q and assumed to have originated  
     21where *dQ(Q)* is the instrumental resolution in *Q* and assumed to have originated  
    2522from pinhole geometry. 
    2623 
    2724Numbers can be separated by spaces or commas. 
    2825 
    29 SasView recognises the following file extensions: 
     26SasView recognises the following file extensions which are not case-sensitive: 
    3027 
    3128*  .TXT 
     
    3431*  .XML (in canSAS format v1.0 and 1.1) 
    3532 
    36 If using CSV output from, for example, a spreadsheet, ensure that it is not  
    37 using commas as delimiters for thousands. 
     33If using CSV output from, for example, a spreadsheet, ensure that it is not using commas as delimiters for thousands. 
     34 
     35The SasView :ref:`File_Converter_Tool` available in SasView 4.1 onwards can be used to convert data sets with separated *I(Q)* and *Q* files (for example, BSL/OTOKO, and some output from FIT2D and other SAXS-oriented software) into either the canSAS SASXML (XML) format or the NeXus NXcanSAS (HDF5) format. 
    3836 
    3937For a description of the CanSAS/SASXML format see: 
    4038http://www.cansas.org/formats/canSAS1d/1.1/doc/ 
    4139 
     40For a description of the ISIS 1D format see: 
     41http://www.isis.stfc.ac.uk/instruments/loq/software/colette-ascii-file-format-descriptions9808.pdf 
     42 
     43For a description of the NXcanSAS format see: 
     44http://cansas-org.github.io/NXcanSAS/classes/contributed_definitions/NXcanSAS.html 
     45 
     46All the above formats are written by the `Mantid Framework <http://www.mantidproject.org/>`_. 
     47 
    4248For a description of the NIST 1D format see: 
    4349http://danse.chem.utk.edu/trac/wiki/NCNROutput1D_IQ 
    4450 
    45 For a description of the ISIS 1D format see: 
    46 http://www.isis.stfc.ac.uk/instruments/loq/software/colette-ascii-file-format-descriptions9808.pdf 
     51For a description of the BSL/OTOKO format see:  
     52http://www.diamond.ac.uk/Beamlines/Soft-Condensed-Matter/small-angle/SAXS-Software/CCP13/BSL.html 
    4753 
    4854.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    4955 
    50 2D Formats SANS 
    51 --------------- 
     562D SAS Formats 
     57-------------- 
    5258 
    53 SasView will only read files in the NIST 2D format with the extensions  
    54 .ASC or .DAT 
     59SasView will read ASCII ('text') files in the NIST 2D format (with the extensions .ASC or .DAT) or files in the NeXus NXcanSAS (HDF5) format (with the extension .H5). File extensions are not case-sensitive. Both of these formats are written by the `Mantid Framework <http://www.mantidproject.org/>`_. 
    5560 
    56 Most of the header lines can be removed except the last line, and only the  
    57 first three columns (Qx, Qy, and I(Qx,Qy)) are actually required. 
     61Most of the header lines in the NIST 2D format can actually be removed except the last line, and only the first three columns (*Qx, Qy,* and *I(Qx,Qy)*) are actually required. 
     62 
     63The SasView :ref:`File_Converter_Tool` available in SasView 4.1 onwards can be used to convert data sets in the 2D BSL/OTOKO format into the NeXus NXcanSAS (HDF5) format. 
    5864 
    5965For a description of the NIST 2D format see: 
    6066http://danse.chem.utk.edu/trac/wiki/NCNROutput1D_2DQxQy  
    6167 
    62 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     68For a description of the NXcanSAS format see:  
     69http://cansas-org.github.io/NXcanSAS/classes/contributed_definitions/NXcanSAS.html 
    6370 
    64 SESANS Format 
    65 ------------- 
    66  
    67 The current file extension is .ses or .sesans (not case sensitive). 
    68  
    69 The file format is to have a list of name-value pairs as a header at the top of the file, detailing general experimental parameters necessary for fitting and analyzing data. This list should contain all information necessary for the file to be 'portable' between users. 
    70  
    71 Following that is a 6 column list of instrument experimental variables: 
    72  
    73 - Spin echo length (z, in Angstroms) 
    74 - Spin echo length error (:math:`\Delta` z, in Angstroms) (experimental resolution) 
    75 - neutron wavelength (:math:`\lambda`, in Angstroms) (essential for ToF instruments) 
    76 - neutron wavelength error (:math:`\Delta \lambda`, in Angstroms) 
    77 - Normalized polarization (:math:`P/P_0`, unitless) 
    78 - Normalized polarization error (:math:`\Delta(P/P_0)`, unitless) (measurement error) 
     71For a description of the BSL/OTOKO format see: For a description of the BSL/OTOKO format see:  
     72http://www.diamond.ac.uk/Beamlines/Soft-Condensed-Matter/small-angle/SAXS-Software/CCP13/BSL.html 
    7973 
    8074 
    8175.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    8276 
    83 .. note::  This help document was last changed by Wim Bouwman, 05Oct2016 
     771D SESANS Format 
     78---------------- 
     79 
     80SasView version 4.1 onwards will read ASCII ('text') files in a prototype SESANS standard format (with the extensions .SES or .SESANS). The file extensions are not case-sensitive. 
     81 
     82The file format has a list of name-value pairs at the top of the file which detail the general experimental parameters necessary for fitting and analyzing data. This list should contain all the information necessary for the file to be 'portable' between users. 
     83 
     84Following the header is a 6 column list of instrument experimental variables: 
     85 
     86- Spin echo length (z, in Angstroms) 
     87- Spin echo length error (:math:`\Delta`\ z, in Angstroms) (experimental resolution) 
     88- Neutron wavelength (:math:`\lambda`, in Angstroms) (essential for ToF instruments) 
     89- Neutron wavelength error (:math:`\Delta \lambda`, in Angstroms) 
     90- Normalized polarization (:math:`P/P_0`, unitless) 
     91- Normalized polarization error (:math:`\Delta(P/P_0)`, unitless) (measurement error) 
     92 
     93.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     94 
     95.. note::  This help document was last changed by Steve King, 07Oct2016 
  • src/sas/sasgui/guiframe/panel_base.py

    rd85c194 r18b7ecb9  
    317317        """ 
    318318        return self._drag_flag 
    319      
     319 
     320    def _set_analysis(self, flag): 
     321        """ 
     322        Set the Analysis Save state flag and informs the manager 
     323        so it refreshes the menu/whole panel 
     324        """ 
     325        self._set_save_flag(flag) 
     326        if self._manager is not None: 
     327            wx.PostEvent(self._manager.parent, PanelOnFocusEvent(panel=self)) 
     328 
    320329    def _set_reset_flag(self, flag=True): 
    321330        """ 
Note: See TracChangeset for help on using the changeset viewer.