Changes in / [8cec26b:444a657] in sasview
- Location:
- src/sas
- Files:
-
- 2 added
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/manipulations.py
r46cd1c3 r324e0bf 199 199 z_max = max(data2D.q_data) 200 200 z_min = min(data2D.q_data) 201 x_max = data2D.dqx_data[data2D.q_data[z_max]]202 x_min = data2D.dqx_data[data2D.q_data[z_min]]203 y_max = data2D.dqy_data[data2D.q_data[z_max]]204 y_min = data2D.dqy_data[data2D.q_data[z_min]]201 dqx_at_z_max = data2D.dqx_data[np.argmax(data2D.q_data)] 202 dqx_at_z_min = data2D.dqx_data[np.argmin(data2D.q_data)] 203 dqy_at_z_max = data2D.dqy_data[np.argmax(data2D.q_data)] 204 dqy_at_z_min = data2D.dqy_data[np.argmin(data2D.q_data)] 205 205 # Find qdx at q = 0 206 dq_overlap_x = ( x_min * z_max - x_max * z_min) / (z_max - z_min)206 dq_overlap_x = (dqx_at_z_min * z_max - dqx_at_z_max * z_min) / (z_max - z_min) 207 207 # when extrapolation goes wrong 208 208 if dq_overlap_x > min(data2D.dqx_data): … … 210 210 dq_overlap_x *= dq_overlap_x 211 211 # Find qdx at q = 0 212 dq_overlap_y = ( y_min * z_max - y_max * z_min) / (z_max - z_min)212 dq_overlap_y = (dqy_at_z_min * z_max - dqy_at_z_max * z_min) / (z_max - z_min) 213 213 # when extrapolation goes wrong 214 214 if dq_overlap_y > min(data2D.dqy_data): … … 220 220 # Final protection of dq 221 221 if dq_overlap < 0: 222 dq_overlap = y_min222 dq_overlap = dqy_at_z_min 223 223 dqx_data = data2D.dqx_data[np.isfinite(data2D.data)] 224 224 dqy_data = data2D.dqy_data[np.isfinite( -
src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py
r7432acb r3e5648b 361 361 if self.slicer.__class__.__name__ != "BoxSum": 362 362 wx_id = ids.next() 363 slicerpop.Append(wx_id, '&Edit Slicer Parameters') 363 name = '&Edit Slicer Parameters and Batch Slicing' 364 slicerpop.Append(wx_id, name) 364 365 wx.EVT_MENU(self, wx_id, self._onEditSlicer) 365 366 slicerpop.AppendSeparator() … … 532 533 533 534 """ 534 # #Clear current slicer535 # Clear current slicer 535 536 if self.slicer is not None: 536 537 self.slicer.clear() 537 # #Create a new slicer538 # Create a new slicer 538 539 self.slicer_z += 1 539 540 self.slicer = slicer(self, self.subplot, zorder=self.slicer_z) 540 541 self.subplot.set_ylim(self.data2D.ymin, self.data2D.ymax) 541 542 self.subplot.set_xlim(self.data2D.xmin, self.data2D.xmax) 542 # #Draw slicer543 # Draw slicer 543 544 self.update() 544 545 self.slicer.update() … … 572 573 npt = math.floor(npt) 573 574 from sas.sascalc.dataloader.manipulations import CircularAverage 574 # #compute the maximum radius of data2D575 # compute the maximum radius of data2D 575 576 self.qmax = max(math.fabs(self.data2D.xmax), 576 577 math.fabs(self.data2D.xmin)) … … 578 579 math.fabs(self.data2D.ymin)) 579 580 self.radius = math.sqrt(math.pow(self.qmax, 2) + math.pow(self.ymax, 2)) 580 # #Compute beam width581 # Compute beam width 581 582 bin_width = (self.qmax + self.qmax) / npt 582 # #Create data1D circular average of data2D583 # Create data1D circular average of data2D 583 584 Circle = CircularAverage(r_min=0, r_max=self.radius, 584 585 bin_width=bin_width) … … 599 600 new_plot.name = "Circ avg " + self.data2D.name 600 601 new_plot.source = self.data2D.source 601 # new_plot.info = self.data2D.info602 # new_plot.info = self.data2D.info 602 603 new_plot.interactive = True 603 604 new_plot.detector = self.data2D.detector 604 605 605 # #If the data file does not tell us what the axes are, just assume...606 # If the data file does not tell us what the axes are, just assume... 606 607 new_plot.xaxis("\\rm{Q}", "A^{-1}") 607 608 if hasattr(self.data2D, "scale") and \ … … 615 616 new_plot.id = "Circ avg " + self.data2D.name 616 617 new_plot.is_data = True 617 self.parent.update_theory(data_id=self.data2D.id, \ 618 theory=new_plot) 618 self.parent.update_theory(data_id=self.data2D.id, theory=new_plot) 619 619 wx.PostEvent(self.parent, 620 620 NewPlotEvent(plot=new_plot, title=new_plot.name)) … … 630 630 """ 631 631 if self.slicer is not None: 632 from SlicerParametersimport SlicerParameterPanel632 from parameters_panel_slicer import SlicerParameterPanel 633 633 dialog = SlicerParameterPanel(self, -1, "Slicer Parameters") 634 634 dialog.set_slicer(self.slicer.__class__.__name__, … … 668 668 params = self.slicer.get_params() 669 669 ## Create a new panel to display results of summation of Data2D 670 from slicerpanelimport SlicerPanel670 from parameters_panel_boxsum import SlicerPanel 671 671 win = MDIFrame(self.parent, None, 'None', (100, 200)) 672 672 new_panel = SlicerPanel(parent=win, id=-1, … … 758 758 if default_name.count('.') > 0: 759 759 default_name = default_name.split('.')[0] 760 #default_name += "_out"761 760 if self.parent is not None: 762 761 self.parent.show_data2d(data, default_name) 763 762 764 763 def modifyGraphAppearance(self, e): 765 self.graphApp = graphAppearance(self, 'Modify graph appearance', legend=False) 764 self.graphApp = graphAppearance(self, 'Modify graph appearance', 765 legend=False) 766 766 self.graphApp.setDefaults(self.grid_on, self.legend_on, 767 767 self.xaxis_label, self.yaxis_label, -
src/sas/sasgui/guiframe/local_perspectives/plotting/SectorSlicer.py
r7432acb r8de66b6 37 37 ## Absolute value of the Angle between the middle line and any side line 38 38 self.phi = math.pi / 12 39 # Binning base for log/lin binning 40 self.bin_base = 0 39 41 ## Middle line 40 42 self.main_line = LineInteractor(self, self.base.subplot, color='blue', … … 151 153 phimin = -self.left_line.phi + self.main_line.theta 152 154 phimax = self.left_line.phi + self.main_line.theta 155 bin_base = self.bin_base 153 156 if nbins is None: 154 157 nbins = 20 155 158 sect = SectorQ(r_min=0.0, r_max=radius, 156 159 phi_min=phimin + math.pi, 157 phi_max=phimax + math.pi, nbins=nbins )160 phi_max=phimax + math.pi, nbins=nbins, base=bin_base) 158 161 159 162 sector = sect(self.base.data2D) … … 239 242 params["Delta_Phi [deg]"] = math.fabs(self.left_line.phi * 180 / math.pi) 240 243 params["nbins"] = self.nbins 244 params["binning base"] = self.bin_base 241 245 return params 242 246 … … 252 256 phi = math.fabs(params["Delta_Phi [deg]"] * math.pi / 180) 253 257 self.nbins = int(params["nbins"]) 258 self.bin_base = params["binning base"] 254 259 self.main_line.theta = main 255 260 ## Reset the slicer parameters -
src/sas/sasgui/perspectives/fitting/basepage.py
ra1b8fee ra1b8fee 254 254 if not hasattr(self, "model_view"): 255 255 return 256 toggle_mode_on = self.model_view.IsEnabled() 256 toggle_mode_on = self.model_view.IsEnabled() or self.data is None 257 257 if toggle_mode_on: 258 258 if self.enable2D and not check_data_validity(self.data):
Note: See TracChangeset
for help on using the changeset viewer.