Changeset e075203 in sasview for src/sas/sasgui
- Timestamp:
- Mar 22, 2017 10:08:56 AM (8 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- f6bb24d
- Parents:
- 39f0bf4
- Location:
- src/sas/sasgui/guiframe/local_perspectives/plotting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py
r39f0bf4 re075203 532 532 533 533 """ 534 # #Clear current slicer534 # Clear current slicer 535 535 if not self.slicer == None: 536 536 self.slicer.clear() 537 # #Create a new slicer537 # Create a new slicer 538 538 self.slicer_z += 1 539 539 self.slicer = slicer(self, self.subplot, zorder=self.slicer_z) 540 540 self.subplot.set_ylim(self.data2D.ymin, self.data2D.ymax) 541 541 self.subplot.set_xlim(self.data2D.xmin, self.data2D.xmax) 542 # #Draw slicer542 # Draw slicer 543 543 self.update() 544 544 self.slicer.update() … … 560 560 """ 561 561 self.onCircular(event, True) 562 562 563 def onCircular(self, event, ismask=False): 563 564 """ … … 571 572 npt = math.floor(npt) 572 573 from sas.sascalc.dataloader.manipulations import CircularAverage 573 # #compute the maximum radius of data2D574 # compute the maximum radius of data2D 574 575 self.qmax = max(math.fabs(self.data2D.xmax), 575 576 math.fabs(self.data2D.xmin)) … … 577 578 math.fabs(self.data2D.ymin)) 578 579 self.radius = math.sqrt(math.pow(self.qmax, 2) + math.pow(self.ymax, 2)) 579 # #Compute beam width580 # Compute beam width 580 581 bin_width = (self.qmax + self.qmax) / npt 581 # #Create data1D circular average of data2D582 # Create data1D circular average of data2D 582 583 Circle = CircularAverage(r_min=0, r_max=self.radius, 583 584 bin_width=bin_width) … … 598 599 new_plot.name = "Circ avg " + self.data2D.name 599 600 new_plot.source = self.data2D.source 600 # new_plot.info = self.data2D.info601 # new_plot.info = self.data2D.info 601 602 new_plot.interactive = True 602 603 new_plot.detector = self.data2D.detector 603 604 604 # #If the data file does not tell us what the axes are, just assume...605 # If the data file does not tell us what the axes are, just assume... 605 606 new_plot.xaxis("\\rm{Q}", "A^{-1}") 606 607 if hasattr(self.data2D, "scale") and \ … … 614 615 new_plot.id = "Circ avg " + self.data2D.name 615 616 new_plot.is_data = True 616 self.parent.update_theory(data_id=self.data2D.id, \ 617 theory=new_plot) 617 self.parent.update_theory(data_id=self.data2D.id, theory=new_plot) 618 618 wx.PostEvent(self.parent, 619 619 NewPlotEvent(plot=new_plot, title=new_plot.name)) … … 628 628 629 629 """ 630 if self.slicer !=None:630 if self.slicer is not None: 631 631 from parameters_panel_slicer import SlicerParameterPanel 632 632 dialog = SlicerParameterPanel(self, -1, "Slicer Parameters") … … 718 718 Clear the slicer on the plot 719 719 """ 720 if not self.slicer ==None:720 if self.slicer is not None: 721 721 self.slicer.clear() 722 722 self.subplot.figure.canvas.draw() … … 734 734 """ 735 735 event_id = str(evt.GetId()) 736 if self.parent !=None:736 if self.parent is not None: 737 737 self._default_save_location = self.parent._default_save_location 738 738 default_name = self.plots[self.graph.selected_plottable].label … … 757 757 if default_name.count('.') > 0: 758 758 default_name = default_name.split('.')[0] 759 #default_name += "_out" 760 if self.parent != None: 759 if self.parent is not None: 761 760 self.parent.show_data2d(data, default_name) 762 761 763 762 def modifyGraphAppearance(self, e): 764 self.graphApp = graphAppearance(self, 'Modify graph appearance', legend=False) 763 self.graphApp = graphAppearance(self, 'Modify graph appearance', 764 legend=False) 765 765 self.graphApp.setDefaults(self.grid_on, self.legend_on, 766 766 self.xaxis_label, self.yaxis_label, -
src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_slicer.py
r39f0bf4 re075203 46 46 """ 47 47 event.Skip() 48 if event.obj_class ==None:48 if event.obj_class is None: 49 49 self.set_slicer(None, None) 50 50 else: … … 59 59 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 5) 60 60 self.type = type 61 if type ==None:61 if type is None: 62 62 label = "Right-click on 2D plot for slicer options" 63 63 title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT) … … 164 164 try: 165 165 params[item[0]] = float(item[1].GetValue()) 166 item[1].SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)) 166 item[1].SetBackgroundColour( 167 wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)) 167 168 item[1].Refresh() 168 169 except: … … 171 172 item[1].Refresh() 172 173 173 if has_error == False:174 if not has_error: 174 175 # Post parameter event 175 # #parent hieris plotter2D176 # parent here is plotter2D 176 177 event = SlicerParameterEvent(type=self.type, params=params) 177 178 wx.PostEvent(self.parent, event)
Note: See TracChangeset
for help on using the changeset viewer.