Changeset 632e2e8 in sasview


Ignore:
Timestamp:
Nov 20, 2016 5:54:54 AM (7 years ago)
Author:
jhbakker
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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
1cad8a4
Parents:
a5b8253 (diff), 4466a6a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'Jurrian1D_optSESclass' into Jurrian1D_opt

Location:
src/sas
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/data_util/qsmearing.py

    ra5b8253 r632e2e8  
    1414import sys 
    1515from sasmodels import sesans 
    16  
    1716import numpy as np  # type: ignore 
    1817from numpy import pi, exp  # type: ignore 
    19 #from scipy.special import jv as besselj 
    2018 
    21 from sasmodels.resolution import Slit1D, Pinhole1D, SESANS1D 
     19from sasmodels.resolution import Slit1D, Pinhole1D 
     20from sasmodels.sesans import SESANS1D 
    2221from sasmodels.resolution2d import Pinhole2D 
    2322from src.sas.sascalc.data_util.nxsunit import Converter 
     
    6059    # TODO: change other sanity checks to check for file loader instead of data structure? 
    6160    _found_sesans = False 
    62     if data.dx is not None and data.meta_data['loader']=='SESANS': 
     61    #if data.dx is not None and data.meta_data['loader']=='SESANS': 
     62    if data.dx is not None and data.isSesans: 
    6363        if data.dx[0] > 0.0: 
    6464            _found_sesans = True 
     
    6666    if _found_sesans == True: 
    6767        #Pre-compute the Hankel matrix (H) 
    68         H0,H, q_calc = sesans.Hankelconstructor(data) 
     68        qmax, qunits = data.sample.zacceptance 
     69        hankel=sesans.SesansTransform() 
     70        sesans.SesansTransform.set_transform(hankel, 
     71        SE = Converter(data._xunit)(data.x, "A"), 
     72        zaccept = Converter(qunits)(qmax, "1/A"), 
     73        Rmax = 1000000) 
    6974        # Then return the actual transform, as if it were a smearing function 
    70         return PySmear(SESANS1D(data, H0, H, q_calc), model) 
     75        return PySmear(SESANS1D(data, hankel._H0, hankel._H, hankel.q), model) 
    7176 
    7277    _found_resolution = False 
  • src/sas/sasgui/perspectives/fitting/basepage.py

    r9087214 r55db501  
    431431        self.sizer2 = wx.BoxSizer(wx.VERTICAL) 
    432432        self.sizer3 = wx.BoxSizer(wx.VERTICAL) 
    433         self.sizerTrafo = wx.BoxSizer(wx.VERTICAL) 
    434433        self.sizer4 = wx.BoxSizer(wx.VERTICAL) 
    435434        self.sizer5 = wx.BoxSizer(wx.VERTICAL) 
     
    440439        self.sizer2.SetMinSize((PANEL_WIDTH, -1)) 
    441440        self.sizer3.SetMinSize((PANEL_WIDTH, -1)) 
    442         self.sizerTrafo.SetMinSize((PANEL_WIDTH, -1)) 
    443441        self.sizer4.SetMinSize((PANEL_WIDTH, -1)) 
    444442        self.sizer5.SetMinSize((PANEL_WIDTH, -1)) 
     
    449447        self.vbox.Add(self.sizer2) 
    450448        self.vbox.Add(self.sizer3) 
    451         self.vbox.Add(self.sizerTrafo) 
    452449        self.vbox.Add(self.sizer4) 
    453450        self.vbox.Add(self.sizer5) 
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    r4581ac9 r55db501  
    5555        self.weightbt_string = None 
    5656        self.m_name = None 
    57         # transform implementation 
    58         self._fill_Trafo_sizer() 
    59        # self.Trafobt_string() 
    6057        # get smear info from data 
    6158        self._get_smear_info() 
     
    9592        self.parent.on_set_focus(event) 
    9693        self.on_tap_focus() 
    97  
    98     def onTrafo(self, event): 
    99         """ 
    100         On Trafo radio button event, sets the Trafobt_string 
    101         """ 
    102         self.Trafobt_string = event.GetEventObject().GetLabelText() 
    103         self._set_Trafo() 
    104  
    105     def _fill_Trafo_sizer(self): 
    106  
    107         title = "Transform" 
    108         box_description_trafo = wx.StaticBox(self, wx.ID_ANY, str(title)) 
    109         box_description_trafo.SetForegroundColour(wx.BLUE) 
    110         #boxsizer_trafo = wx.StaticBoxSizer(box_description_trafo, wx.VERTICAL) 
    111         boxsizer_trafo = wx.StaticBoxSizer(box_description_trafo, wx.HORIZONTAL) 
    112         #sizer_trafo = wx.StaticBoxSizer(box_description_trafo, wx.HORIZONTAL) 
    113         #weighting_set_box = wx.StaticBox(self, wx.ID_ANY, 
    114          #                              'Select the type of SESANS analysis') 
    115  
    116         #sizer_weighting = wx.BoxSizer(wx.HORIZONTAL) 
    117           #      weighting_box.SetMinSize((_DATA_BOX_WIDTH, 60)) 
    118  
    119         #For every radio button (each statement x3): 
    120         self.no_transform = wx.RadioButton(self, wx.ID_ANY, 
    121                                                   'None', style=wx.RB_GROUP) 
    122  
    123         #self.Bind(wx.EVT_RADIOBUTTON, self.onTrafo, 
    124          #                 id=self.no_transform.GetId()) 
    125         self.hankel = wx.RadioButton(self, wx.ID_ANY, 
    126                                                   'Hankel') 
    127         #self.Bind(wx.EVT_RADIOBUTTON, self.onTrafo, 
    128         #                  id=self.hankel.GetId()) 
    129         self.cosine = wx.RadioButton(self, wx.ID_ANY, 
    130                                                   'Cosine') 
    131         #self.Bind(wx.EVT_RADIOBUTTON, self.onTrafo, 
    132          #                 id=self.cosine.GetId()) 
    133  
    134         #Not sure about this (only once though) 
    135         self.no_transform.SetValue(True) 
    136  
    137         #For every radio button (each statement x3): 
    138         boxsizer_trafo.Add(self.no_transform, 0, wx.LEFT, 10) 
    139         boxsizer_trafo.Add((14, 10)) 
    140         boxsizer_trafo.Add(self.hankel) 
    141         boxsizer_trafo.Add((14, 10)) 
    142         boxsizer_trafo.Add(self.cosine) 
    143         boxsizer_trafo.Add((14, 10)) 
    144             #Default for weighting is False, but these need to be on by default! 
    145         self.no_transform.Enable(True) 
    146  
    147         #Not sure about this (only once though) 
    148         #weighting_box.Add(sizer_trafo) 
    149  
    150         self.sizerTrafo.Clear(True) 
    151         self.sizerTrafo.Add(boxsizer_trafo, 0, wx.EXPAND | wx.ALL, 10) 
    152         #self.sizerTrafo.Add(sizer_trafo, 0, wx.EXPAND | wx.ALL, 10) 
    153         self.sizerTrafo.Layout() 
    15494 
    15595    def _fill_data_sizer(self): 
  • src/sas/sasgui/plottools/PlotPanel.py

    rf5e226c9 ra5b8253  
    9797    """ 
    9898    def __init__(self, parent, id=-1, xtransform=None, 
    99                  ytransform=None, scale='log_10', 
     99                 ytransform=None, scale='log_{10}', 
    100100                 color=None, dpi=None, **kwargs): 
    101101        """ 
Note: See TracChangeset for help on using the changeset viewer.