Changeset 3e5648b in sasview for src


Ignore:
Timestamp:
Apr 10, 2017 11:00:32 AM (7 years ago)
Author:
krzywon
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:
6e6dd4c
Parents:
6267876
git-author:
Jeff Krzywon <krzywon@…> (04/10/17 11:00:32)
git-committer:
krzywon <krzywon@…> (04/10/17 11:00:32)
Message:

Resolve merge conflicts and 2 small fixes to slicer panel. #467

Location:
src/sas
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/manipulations.py

    r7432acb r3e5648b  
    430430            z_max = max(data2D.q_data) 
    431431            z_min = min(data2D.q_data) 
    432             x_max = data2D.dqx_data[data2D.q_data[z_max]] 
    433             x_min = data2D.dqx_data[data2D.q_data[z_min]] 
    434             y_max = data2D.dqy_data[data2D.q_data[z_max]] 
    435             y_min = data2D.dqy_data[data2D.q_data[z_min]] 
     432            x_max = data2D.dqx_data[numpy.where(data2D.q_data == z_max)] 
     433            x_min = data2D.dqx_data[numpy.where(data2D.q_data == z_min)] 
     434            y_max = data2D.dqy_data[numpy.where(data2D.q_data == z_max)] 
     435            y_min = data2D.dqy_data[numpy.where(data2D.q_data == z_min)] 
    436436            # Find qdx at q = 0 
    437437            dq_overlap_x = (x_min * z_max - x_max * z_min) / (z_max - z_min) 
     
    785785            z_max = max(data2D.q_data) 
    786786            z_min = min(data2D.q_data) 
    787             x_max = data2D.dqx_data[data2D.q_data[z_max]] 
    788             x_min = data2D.dqx_data[data2D.q_data[z_min]] 
    789             y_max = data2D.dqy_data[data2D.q_data[z_max]] 
    790             y_min = data2D.dqy_data[data2D.q_data[z_min]] 
     787            x_max = data2D.dqx_data[numpy.where(data2D.q_data == z_max)] 
     788            x_min = data2D.dqx_data[numpy.where(data2D.q_data == z_min)] 
     789            y_max = data2D.dqy_data[numpy.where(data2D.q_data == z_max)] 
     790            y_min = data2D.dqy_data[numpy.where(data2D.q_data == z_min)] 
    791791            # Find qdx at q = 0 
    792792            dq_overlap_x = (x_min * z_max - x_max * z_min) / (z_max - z_min) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py

    r7432acb r3e5648b  
    361361                if self.slicer.__class__.__name__ != "BoxSum": 
    362362                    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) 
    364365                    wx.EVT_MENU(self, wx_id, self._onEditSlicer) 
    365366            slicerpop.AppendSeparator() 
     
    532533 
    533534        """ 
    534         ## Clear current slicer 
     535        # Clear current slicer 
    535536        if self.slicer is not None: 
    536537            self.slicer.clear() 
    537         ## Create a new slicer 
     538        # Create a new slicer 
    538539        self.slicer_z += 1 
    539540        self.slicer = slicer(self, self.subplot, zorder=self.slicer_z) 
    540541        self.subplot.set_ylim(self.data2D.ymin, self.data2D.ymax) 
    541542        self.subplot.set_xlim(self.data2D.xmin, self.data2D.xmax) 
    542         ## Draw slicer 
     543        # Draw slicer 
    543544        self.update() 
    544545        self.slicer.update() 
     
    572573        npt = math.floor(npt) 
    573574        from sas.sascalc.dataloader.manipulations import CircularAverage 
    574         ## compute the maximum radius of data2D 
     575        # compute the maximum radius of data2D 
    575576        self.qmax = max(math.fabs(self.data2D.xmax), 
    576577                        math.fabs(self.data2D.xmin)) 
     
    578579                        math.fabs(self.data2D.ymin)) 
    579580        self.radius = math.sqrt(math.pow(self.qmax, 2) + math.pow(self.ymax, 2)) 
    580         ##Compute beam width 
     581        # Compute beam width 
    581582        bin_width = (self.qmax + self.qmax) / npt 
    582         ## Create data1D circular average of data2D 
     583        # Create data1D circular average of data2D 
    583584        Circle = CircularAverage(r_min=0, r_max=self.radius, 
    584585                                 bin_width=bin_width) 
     
    599600        new_plot.name = "Circ avg " + self.data2D.name 
    600601        new_plot.source = self.data2D.source 
    601         #new_plot.info = self.data2D.info 
     602        # new_plot.info = self.data2D.info 
    602603        new_plot.interactive = True 
    603604        new_plot.detector = self.data2D.detector 
    604605 
    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... 
    606607        new_plot.xaxis("\\rm{Q}", "A^{-1}") 
    607608        if hasattr(self.data2D, "scale") and \ 
     
    615616        new_plot.id = "Circ avg " + self.data2D.name 
    616617        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) 
    619619        wx.PostEvent(self.parent, 
    620620                     NewPlotEvent(plot=new_plot, title=new_plot.name)) 
     
    630630        """ 
    631631        if self.slicer is not None: 
    632             from SlicerParameters import SlicerParameterPanel 
     632            from parameters_panel_slicer import SlicerParameterPanel 
    633633            dialog = SlicerParameterPanel(self, -1, "Slicer Parameters") 
    634634            dialog.set_slicer(self.slicer.__class__.__name__, 
     
    668668        params = self.slicer.get_params() 
    669669        ## Create a new panel to display results of summation of Data2D 
    670         from slicerpanel import SlicerPanel 
     670        from parameters_panel_boxsum import SlicerPanel 
    671671        win = MDIFrame(self.parent, None, 'None', (100, 200)) 
    672672        new_panel = SlicerPanel(parent=win, id=-1, 
     
    758758        if default_name.count('.') > 0: 
    759759            default_name = default_name.split('.')[0] 
    760         #default_name += "_out" 
    761760        if self.parent is not None: 
    762761            self.parent.show_data2d(data, default_name) 
    763762 
    764763    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) 
    766766        self.graphApp.setDefaults(self.grid_on, self.legend_on, 
    767767                                  self.xaxis_label, self.yaxis_label, 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_slicer.py

    r3f75203 r3e5648b  
    1414 
    1515FIT_OPTIONS = ["No fitting", "Fitting", "Batch Fitting"] 
     16CONVERT_KEYS = ["SectorInteractor", "AnnulusInteractor", "BoxInteractorX", 
     17                "BoxInteractorY"] 
    1618CONVERT_DICT = {"SectorInteractor": "SectorQ", 
    1719                "AnnulusInteractor": "AnnulusPhi", 
     
    138140            self.bck.Add(text, (iy, ix), (1, 1), 
    139141                         wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
    140             self.type_list = CONVERT_DICT.keys() 
     142            self.type_list = CONVERT_KEYS 
    141143            self.type_select = wx.ComboBox(parent=self, choices=self.type_list) 
    142144            self.type_select.Bind(wx.EVT_COMBOBOX, self.on_change_slicer) 
     
    331333        Populate the check list from the currently plotted 2D data 
    332334        """ 
     335        # Reinitialize loaded data list on redraw 
     336        self.loaded_data = [] 
    333337        # Iterate over the loaded plots and find all 2D panels 
    334338        for key, value in self.main_window.plot_panels.iteritems(): 
Note: See TracChangeset for help on using the changeset viewer.