Changeset ceaf16e in sasview
- Timestamp:
- Jun 13, 2009 11:43:01 AM (16 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:
- 5cc847c
- Parents:
- 009f827
- Location:
- prview/perspectives/pr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
prview/perspectives/pr/inversion_panel.py
ra00ee4c rceaf16e 7 7 import wx 8 8 import os 9 import sys 10 import logging 9 11 from sans.guicomm.events import StatusEvent 10 12 from inversion_state import InversionState … … 955 957 if path and os.path.isfile(path): 956 958 self.plot_data.SetValue(str(path)) 957 self.manager.show_data(path, reset=True) 958 self._on_pars_changed(None) 959 960 # Perform inversion 961 if self.standalone == True: 962 self._on_invert(None) 959 try: 960 self.manager.show_data(path, reset=True) 961 self._on_pars_changed(None) 962 963 # Perform inversion 964 if self.standalone == True: 965 self._on_invert(None) 966 except: 967 # Invalid data 968 logging.error("InversionControl._change_file: %s" % sys.exc_value) 963 969 964 970 class HelpDialog(wx.Dialog): -
prview/perspectives/pr/pr.py
r0d88a09 rceaf16e 412 412 # Use data loader to load file 413 413 dataread = Loader().load(path) 414 415 # Notify the user if we could not read the file 416 if dataread is None: 417 raise RuntimeError, "Invalid data" 418 414 419 x = None 415 420 y = None … … 827 832 @param reset: if True all other plottables will be cleared 828 833 """ 829 830 831 834 if path is not None: 832 835 try: 833 836 pr = self._create_file_pr(path) 834 835 # If the file contains nothing, just return 836 if pr is None: 837 return 838 839 self.pr = pr 840 except: 841 wx.PostEvent(self.parent, StatusEvent(status=sys.exc_value)) 842 return 837 except: 838 status="Problem reading data: %s" % sys.exc_value 839 wx.PostEvent(self.parent, StatusEvent(status=status)) 840 raise RuntimeError, status 841 842 # If the file contains nothing, just return 843 if pr is None: 844 raise RuntimeError, "Loaded data is invalid" 845 846 self.pr = pr 843 847 844 848 # Make a plot of I(q) data … … 925 929 @param path: path of the file to read in 926 930 """ 931 # Sanity check 932 if self.current_plottable is None: 933 msg = "Please load a valid data set before proceeding." 934 wx.PostEvent(self.parent, StatusEvent(status=msg)) 935 return None 936 927 937 # Get the data from the chosen data set and perform inversion 928 938 pr = Invertor() … … 1031 1041 #TODO: refactor this into a proper status handling 1032 1042 wx.PostEvent(self.parent, StatusEvent(status='')) 1033 x, y, err = self.load(path) 1043 try: 1044 x, y, err = self.load(path) 1045 except: 1046 message = "Could not read the data file: %s" % path 1047 wx.PostEvent(self.parent, StatusEvent(status=message)) 1048 return None 1034 1049 1035 1050 # If the file contains no data, just return 1036 #TODO: clean this up: we need a way to recognize that not all P(r) files are data1037 1051 if x is None: 1052 message = "The loaded file contains no data" 1053 wx.PostEvent(self.parent, StatusEvent(status=message)) 1038 1054 return None 1039 1055
Note: See TracChangeset
for help on using the changeset viewer.