Changeset 077207b in sasview for calculatorview/src/sans/perspectives
- Timestamp:
- Jan 4, 2013 9:30:31 AM (12 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:
- d7b6913
- Parents:
- ab7e3a4
- Location:
- calculatorview/src/sans/perspectives/calculator
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
calculatorview/src/sans/perspectives/calculator/gen_scatter_panel.py
rdbc5dc9b r077207b 20 20 21 21 from data_util.calcthread import CalcThread 22 #from sans.guiframe.local_perspectives.plotting.Plotter2D import ModelPanel2D \23 # as PlotPanel24 #from danse.common.plottools.PlotPanel import PlotPanel25 #from danse.common.plottools.SimplePlot import PlotFrame26 22 from sans.guiframe.local_perspectives.plotting.SimplePlot import PlotFrame 27 #from danse.common.plottools.plottables import Graph28 23 from sans.guiframe.dataFitting import Data2D 29 #from sans.guiframe.utils import PanelMenu30 24 from sans.dataloader.data_info import Detector 31 25 from sans.dataloader.data_info import Source … … 38 32 from wx.lib.scrolledpanel import ScrolledPanel 39 33 from sans.perspectives.calculator.load_thread import GenReader 40 #import matplotlib.pyplot as plt41 34 from danse.common.plottools.arrow3d import Arrow3D 42 #from danse.common.plottools.toolbar import NavigationToolBar 35 43 36 _BOX_WIDTH = 76 44 37 #Slit length panel size … … 51 44 PANEL_HEIGHT = 370 52 45 FONT_VARIANT = 1 53 _QMAX_DEFAULT = 0. 146 _QMAX_DEFAULT = 0.3 54 47 _NPTS_DEFAULT = 50 55 48 … … 434 427 for type in omf_type: 435 428 wildcard.append(type) 436 #for type in pdb_type:437 #wildcard.append(type)429 for type in pdb_type: 430 wildcard.append(type) 438 431 wildcard = '|'.join(wildcard) 439 432 dlg = wx.FileDialog(self, "Choose a file", location, … … 474 467 if self.reader is not None and self.reader.isrunning(): 475 468 self.reader.stop() 469 self.browse_button.Enable(False) 470 self.browse_button.SetLabel("Loading...") 476 471 if self.parent.parent is not None: 477 472 wx.PostEvent(self.parent.parent, … … 482 477 updatefn=self.load_update) 483 478 self.reader.queue() 484 self.load_update()479 #self.load_update() 485 480 except: 486 481 self.ext = None … … 496 491 """ 497 492 print update on the status bar 498 """ 493 """ 499 494 if self.parent.parent is None: 500 495 return … … 511 506 """ 512 507 #compute the slit size 508 self.browse_button.Enable(True) 509 self.browse_button.SetLabel('Load') 513 510 try: 514 511 filename = data.filename … … 529 526 self._set_sld_data_helper(True) 530 527 except: 531 #raise532 528 if self.parent.parent is None: 533 r eturn529 raise 534 530 msg = "Loading Error: This file format is not supported " 535 531 msg += "for GenSANS." … … 540 536 if self.parent.parent is None: 541 537 return 538 542 539 msg = "Load Complete" 543 540 wx.PostEvent(self.parent.parent, StatusEvent(status=msg, type='stop')) … … 619 616 is_zero = sld_tot == 0.0 620 617 if is_zero.any(): 621 ax.plot(pos_x[is_zero], pos_ y[is_zero], pos_z[is_zero], marker,618 ax.plot(pos_x[is_zero], pos_z[is_zero], pos_y[is_zero], marker, 622 619 c="y", alpha=0.5, markeredgecolor='y', 623 620 markersize=m_size) … … 629 626 sld_mz = sld_mz[is_nonzero] 630 627 631 ax.plot(pos_x, pos_ y,632 pos_z,marker, c="k",628 ax.plot(pos_x, pos_z, pos_y, 629 marker, c="k", 633 630 alpha=0.5, markeredgecolor="k", markersize=m_size) 634 631 … … 671 668 color_z)) 672 669 673 arrows = Arrow3D(panel, x_arrow, y_arrow,674 z_arrow,colors,670 arrows = Arrow3D(panel, x_arrow, z_arrow, y_arrow, 671 colors, 675 672 mutation_scale=10, lw=1, 676 673 arrowstyle="->", alpha = 0.5) … … 692 689 panel.subplot.figure.subplots_adjust(left=0.05, right=0.95, 693 690 bottom=0.05, top=0.96) 691 # Use y, z axes (in mpl 3d) as z, y axes 692 # that consistent with SANS coords. 694 693 ax.set_xlabel('x ($\A%s$)'% output.pos_unit) 695 ax.set_ylabel(' y($\A%s$)'% output.pos_unit)696 ax.set_zlabel(' z($\A%s$)'% output.pos_unit)694 ax.set_ylabel('z ($\A%s$)'% output.pos_unit) 695 ax.set_zlabel('y ($\A%s$)'% output.pos_unit) 697 696 num_graph = str(self.graph_num) 698 697 frame.SetTitle('Graph %s: %s'% (num_graph, graph_title)) … … 1137 1136 1138 1137 self.npixels_sizer = wx.BoxSizer(wx.HORIZONTAL) 1139 self.box_sld = wx.StaticBox(self, -1, str("Mean SLD")) 1138 self.box_sld = wx.StaticBox(self, -1, 1139 str("Scattering Length (Density)")) 1140 1140 self.box_node = wx.StaticBox(self, -1, str("Nodes")) 1141 1141 self.boxsizer_sld = wx.StaticBoxSizer(self.box_sld, wx.VERTICAL) … … 1360 1360 def set_sld_ctr(self, sld_data): 1361 1361 """ 1362 Set sld textctrls 1362 1363 """ 1363 1364 if sld_data == None: … … 1375 1376 max_val = numpy.max(sld_list[key]) 1376 1377 mean_val = numpy.mean(sld_list[key]) 1377 enable = (min_val == max_val) 1378 enable = (min_val == max_val) and \ 1379 sld_data.pix_type == 'pixel' 1378 1380 ctr_list[1].SetValue(format_number(mean_val, True)) 1379 1381 ctr_list[1].Enable(enable) -
calculatorview/src/sans/perspectives/calculator/media/gen_sans_help.html
r318b5bbb r077207b 112 112 </p> 113 113 <br> 114 *Note: The values of 'Up_frac_i' and 'Up_frac_f' must be in the range between 0 and 1. 114 *Note I: The values of 'Up_frac_i' and 'Up_frac_f' must be in the range between 0 and 1. 115 For example, both values are 0.5 for unpolarized neutrons. 116 <br> 117 *Note II: The unit of intensity calculated from .sld, .omf, or .txt files is 1/cm, otherwise 118 it is Å<sup>2</sup>. (In the first equation above, the V is set to 1.) 119 <br> 120 *Note III: This computation is totally based on the pixel (or atomic) data fixed 121 in the xyz coordinates. Thus no angular orientational averaging is considered. 122 <br> 123 *Note IV: For the neutron scattering length density, only the its real component is taken account. 115 124 </body>
Note: See TracChangeset
for help on using the changeset viewer.