Changeset 1c9419f4 in sasview for guiframe/data_loader.py
- Timestamp:
- Oct 9, 2008 3:45:38 PM (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:
- 2139c3f
- Parents:
- 126a761
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_loader.py
rfb8d4050 r1c9419f4 62 62 def plot_data(parent, path, name="Loaded Data"): 63 63 from sans.guicomm.events import NewPlotEvent, StatusEvent 64 #from sans.guitools.plottables import Data1D, Theory1D 65 from danse.common.plottools.plottables import Data1D, Theory1D, Data2D 64 66 from DataLoader.loader import Loader 67 import numpy 65 68 #Instantiate a loader 66 69 L=Loader() … … 72 75 wx.PostEvent(parent, StatusEvent(status="Problem loading file: %s" % sys.exc_value)) 73 76 return 74 75 if type(output).__name__=='list': 76 for i in range(len(output)): 77 _plot_single_data(parent, output[i], path, name, str(i)) 77 if hasattr(data): 78 new_plot = Data2D(image= output.data) 79 new_plot.setValues(output) 78 80 else: 79 _plot_single_data(parent, output, path, name) 80 81 def _plot_single_data(parent, output, path, name="Loaded Data", index=None): 82 """ 83 Plot a single data set 84 @param output: data set to plot 85 """ 86 from sans.guicomm.events import NewPlotEvent 87 from sans.guitools.plottables import Data1D, Theory1D 88 89 if output.dy==None: 90 new_plot = Theory1D(output.x, output.y) 91 else: 92 new_plot = Data1D(output.x, output.y, dy=output.dy) 81 if output.dy==None: 82 new_plot = Theory1D(output.x, output.y) 83 else: 84 new_plot = Data1D(output.x, output.y, dy=output.dy) 93 85 94 86 filename = os.path.basename(path) 95 if index is not None:96 filename += "(%s)" % index97 87 98 88 new_plot.name = name … … 104 94 new_plot.group_id = filename 105 95 106 title = filename 107 if len(output.title) > 0: 108 title = filename+'['+output.title+']' 109 110 wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=title)) 96 wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=filename))
Note: See TracChangeset
for help on using the changeset viewer.