Changeset 8e87ece in sasview
- Timestamp:
- Apr 8, 2010 6:08:04 PM (15 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:
- 2fff4db
- Parents:
- edcbd467
- Location:
- guiframe
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/dataFitting.py
r20b6760 r8e87ece 2 2 Adapters for fitting module 3 3 """ 4 import copy 5 import numpy 6 4 7 from danse.common.plottools.plottables import Data1D as PlotData1D 5 8 from danse.common.plottools.plottables import Data2D as PlotData2D … … 9 12 from DataLoader.data_info import Data2D as LoadData2D 10 13 11 import copy12 13 14 class Data1D(PlotData1D, LoadData1D): 14 15 15 def __init__(self, x=[],y=[],dx=None,dy=None):16 def __init__(self, x=[], y=[], dx=None, dy=None): 16 17 PlotData1D.__init__(self, x, y, dx, dy) 17 18 LoadData1D.__init__(self, x, y, dx, dy) … … 25 26 """ 26 27 self.x = copy.deepcopy(data1d.x) 27 self.dx = copy.deepcopy(data1d.dx)28 28 self.y = copy.deepcopy(data1d.y) 29 29 self.dy = copy.deepcopy(data1d.dy) 30 self.dxl = copy.deepcopy(data1d.dxl) 31 self.dxw = copy.deepcopy(data1d.dxw) 30 31 if hasattr(data1d, "dx"): 32 self.dx = copy.deepcopy(data1d.dx) 33 if hasattr(data1d, "dxl"): 34 self.dxl = copy.deepcopy(data1d.dxl) 35 if hasattr(data1d, "dxw"): 36 self.dxw = copy.deepcopy(data1d.dxw) 32 37 33 38 self.xaxis(data1d._xaxis,data1d._xunit) … … 47 52 LoadData1D.__init__(self, x, y, dy) 48 53 self.id= None 49 self.group_id = None54 self.group_id = None 50 55 self.is_data = True 51 56 … … 57 62 self.y = copy.deepcopy(data1d.y) 58 63 self.dy = copy.deepcopy(data1d.dy) 59 64 if hasattr(data1d, "dx"): 65 self.dx = copy.deepcopy(data1d.dx) 66 if hasattr(data1d, "dxl"): 67 self.dxl = copy.deepcopy(data1d.dxl) 68 if hasattr(data1d, "dxw"): 69 self.dxw = copy.deepcopy(data1d.dxw) 60 70 self.xaxis(data1d._xaxis,data1d._xunit) 61 71 self.yaxis(data1d._yaxis,data1d._yunit) 72 62 73 def __str__(self): 63 74 """ -
guiframe/local_perspectives/plotting/Plotter1D.py
rb91c736 r8e87ece 18 18 import time 19 19 20 from copy import deepcopy 20 21 import danse.common.plottools 21 22 from danse.common.plottools.PlotPanel import PlotPanel … … 299 300 name =self.plots[self.graph.selected_plottable].name 300 301 dy = self.plots[self.graph.selected_plottable].dy 301 self.err_dy[name]= d y302 self.err_dy[name]= deepcopy(dy) 302 303 ## Create a new dy for a new plottable 303 import numpy304 dy = numpy.zeros(len(self.plots[self.graph.selected_plottable].y))304 305 dy = numpy.zeros(len(self.plots[self.graph.selected_plottable].y)) 305 306 selected_plot= self.plots[self.graph.selected_plottable] 306 307 #post the removed error to the parent 308 event = ErrorDataEvent(err_dy= deepcopy(self.err_dy)) 309 wx.PostEvent(self.parent, event) 307 310 if selected_plot.__class__.__name__=="Data1D": 308 311 # Make sure that we can pass a basic Data1D … … 345 348 ## save the plot 346 349 self.plots[self.graph.selected_plottable]=new_plot 350 347 351 ## Render the graph 348 352 self.graph.render(self) 349 353 self.subplot.figure.canvas.draw_idle() 350 354 351 event = ErrorDataEvent(err_dy=self.err_dy)352 wx.PostEvent(self.parent, event)353 354 355 355 def _on_add_errors(self, evt): 356 356 """ … … 361 361 @param evt: Menu event 362 362 """ 363 364 365 363 if not self.graph.selected_plottable == None \ 366 364 and self.graph.selected_plottable in self.plots.keys(): … … 374 372 375 373 try: 376 dy = self.err_dy[selected_plot.name]374 dy = deepcopy(self.err_dy[selected_plot.name]) 377 375 378 376 except:
Note: See TracChangeset
for help on using the changeset viewer.