Ignore:
Timestamp:
Jan 4, 2013 9:30:31 AM (11 years ago)
Author:
Jae Cho <jhjcho@…>
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
Message:

added pdb reader

File:
1 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/src/sans/perspectives/calculator/gen_scatter_panel.py

    rdbc5dc9b r077207b  
    2020 
    2121from data_util.calcthread import CalcThread 
    22 #from sans.guiframe.local_perspectives.plotting.Plotter2D import ModelPanel2D \ 
    23 #                    as PlotPanel 
    24 #from danse.common.plottools.PlotPanel import PlotPanel 
    25 #from danse.common.plottools.SimplePlot import PlotFrame 
    2622from sans.guiframe.local_perspectives.plotting.SimplePlot import PlotFrame 
    27 #from danse.common.plottools.plottables import Graph 
    2823from sans.guiframe.dataFitting import Data2D 
    29 #from sans.guiframe.utils import PanelMenu 
    3024from sans.dataloader.data_info import Detector 
    3125from sans.dataloader.data_info import Source 
     
    3832from wx.lib.scrolledpanel import ScrolledPanel 
    3933from sans.perspectives.calculator.load_thread import GenReader 
    40 #import matplotlib.pyplot as plt 
    4134from danse.common.plottools.arrow3d import Arrow3D 
    42 #from danse.common.plottools.toolbar import NavigationToolBar 
     35 
    4336_BOX_WIDTH = 76 
    4437#Slit length panel size  
     
    5144    PANEL_HEIGHT = 370 
    5245    FONT_VARIANT = 1 
    53 _QMAX_DEFAULT = 0.1 
     46_QMAX_DEFAULT = 0.3 
    5447_NPTS_DEFAULT = 50  
    5548 
     
    434427        for type in omf_type: 
    435428            wildcard.append(type) 
    436         #for type in pdb_type: 
    437         #    wildcard.append(type) 
     429        for type in pdb_type: 
     430            wildcard.append(type) 
    438431        wildcard = '|'.join(wildcard) 
    439432        dlg = wx.FileDialog(self, "Choose a file", location, 
     
    474467            if self.reader is not None and self.reader.isrunning(): 
    475468                self.reader.stop() 
     469            self.browse_button.Enable(False) 
     470            self.browse_button.SetLabel("Loading...") 
    476471            if self.parent.parent is not None: 
    477472                wx.PostEvent(self.parent.parent,  
     
    482477                                    updatefn=self.load_update) 
    483478            self.reader.queue() 
    484             self.load_update() 
     479            #self.load_update() 
    485480        except: 
    486481            self.ext = None 
     
    496491        """ 
    497492        print update on the status bar 
    498         """ 
     493        """        
    499494        if self.parent.parent is None: 
    500495                return  
     
    511506        """ 
    512507        #compute the slit size 
     508        self.browse_button.Enable(True) 
     509        self.browse_button.SetLabel('Load') 
    513510        try: 
    514511            filename = data.filename 
     
    529526            self._set_sld_data_helper(True) 
    530527        except: 
    531             #raise 
    532528            if self.parent.parent is None: 
    533                 return  
     529                raise 
    534530            msg = "Loading Error: This file format is not supported " 
    535531            msg += "for GenSANS."  
     
    540536        if self.parent.parent is None: 
    541537            return  
     538         
    542539        msg = "Load Complete" 
    543540        wx.PostEvent(self.parent.parent, StatusEvent(status=msg, type='stop')) 
     
    619616        is_zero = sld_tot == 0.0   
    620617        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,  
    622619                        c="y", alpha=0.5, markeredgecolor='y',  
    623620                        markersize=m_size)  
     
    629626            sld_mz = sld_mz[is_nonzero] 
    630627 
    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",  
    633630                alpha=0.5, markeredgecolor="k", markersize=m_size)  
    634631         
     
    671668                                                      color_z)) 
    672669                         
    673                         arrows = Arrow3D(panel, x_arrow, y_arrow,  
    674                                                   z_arrow, colors,  
     670                        arrows = Arrow3D(panel, x_arrow, z_arrow, y_arrow,  
     671                                                  colors,  
    675672                                                  mutation_scale=10, lw=1,  
    676673                                                  arrowstyle="->", alpha = 0.5) 
     
    692689        panel.subplot.figure.subplots_adjust(left=0.05, right=0.95,  
    693690                                             bottom=0.05, top=0.96) 
     691        # Use y, z axes (in mpl 3d) as z, y axes  
     692        # that consistent with SANS coords. 
    694693        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) 
    697696        num_graph = str(self.graph_num) 
    698697        frame.SetTitle('Graph %s: %s'% (num_graph, graph_title))         
     
    11371136         
    11381137        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)")) 
    11401140        self.box_node = wx.StaticBox(self, -1, str("Nodes")) 
    11411141        self.boxsizer_sld = wx.StaticBoxSizer(self.box_sld, wx.VERTICAL) 
     
    13601360    def set_sld_ctr(self, sld_data): 
    13611361        """ 
     1362        Set sld textctrls 
    13621363        """ 
    13631364        if sld_data == None: 
     
    13751376                    max_val = numpy.max(sld_list[key]) 
    13761377                    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' 
    13781380                    ctr_list[1].SetValue(format_number(mean_val, True)) 
    13791381                    ctr_list[1].Enable(enable) 
Note: See TracChangeset for help on using the changeset viewer.