当前位置: 首页>>代码示例>>Python>>正文


Python SDAPlotter.getGuiBean方法代码示例

本文整理汇总了Python中uk.ac.diamond.scisoft.analysis.SDAPlotter.getGuiBean方法的典型用法代码示例。如果您正苦于以下问题:Python SDAPlotter.getGuiBean方法的具体用法?Python SDAPlotter.getGuiBean怎么用?Python SDAPlotter.getGuiBean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在uk.ac.diamond.scisoft.analysis.SDAPlotter的用法示例。


在下文中一共展示了SDAPlotter.getGuiBean方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ncdredconf

# 需要导入模块: from uk.ac.diamond.scisoft.analysis import SDAPlotter [as 别名]
# 或者: from uk.ac.diamond.scisoft.analysis.SDAPlotter import getGuiBean [as 别名]
    def ncdredconf(self, detector, **kwords):
        """
            if default None passed in no change is made
            default is everything off
        """
        
        if detector.lower() == "Waxs".lower():
            detector="Waxs"
        else:
            detector="Saxs"
            
        if not detector in self.settings:
            self.settings[detector] = {}
        for i in self.options:
            if not i in self.settings[detector]:
                self.settings[detector][i] = False
            if i in kwords:
                if kwords[i] == None:
                    self.settings[detector][i] = False
                else:
                    self.settings[detector][i] = kwords[i]
        
        realdet=ncdutils.getDetectorByType(self.detsystem, detector.upper())
        realdetname = realdet.getName()
        ncdutils.removeDetectorByName(self.detsystem, detector+" chain")
        
        saxsrc=ReductionChain(detector+" chain", realdetname)
        saxsrclist=saxsrc.getChain()
        
        panel=detector+" Plot"
        beanbag=SDAPlotter.getGuiBean(panel)
        if beanbag == None:
            beanbag = {}
        
        sroi = None
        if self.is2D(realdet):
            if GuiParameters.ROIDATA in beanbag:
                roi = beanbag[GuiParameters.ROIDATA]
                if isinstance(roi, SectorROI):
                    sroi = roi
                    radii = sroi.getRadii()
                    self.settings[detector]["length"]=int(math.ceil(radii[1]-radii[0]))
                    self.settings[detector]["disttobeamstop"]=radii[0]

        length =  self.settings[detector]["length"]
        slope =  self.settings[detector]["slope"]
        intercept =  self.settings[detector]["intercept"]
        if slope == 0 or slope == False:
            axisds=None
        else:
            axis=[]
            pis = realdet.getPixelSize()*1000
            d2b = self.settings[detector]["disttobeamstop"]
            for i in range(length):
                axis.append(float((i+d2b)*pis*slope+intercept))
            axisds=DataSet("qaxis", axis)
            
        mask =  self.settings[detector]["mask"]
        sect =  self.settings[detector]["sect"]
        if sroi != None:
            if sect or isinstance(axisds, DataSet):
                    start = sroi.getPoint()
                    realdet.setAttribute("beam_center_x", start[0])
                    realdet.setAttribute("beam_center_y", start[1])
            else:
                    realdet.setAttribute("beam_center_x", None)
                    realdet.setAttribute("beam_center_y", None)
                    
        cameralength = self.settings[detector]["cameralength"]
        if cameralength != False:
            realdet.setAttribute("distance", cameralength)
        else:
            realdet.setAttribute("distance", None)
            
        norm = self.settings[detector]["norm"]
        if (norm != False):
            saxsnorm=Normalisation(detector+"norm","ignored")
            saxsnorm.setCalibChannel(1)
            saxsnorm.setCalibName(ncdutils.getDetectorByType(self.detsystem, "CALIB").getName())
            saxsrclist.add(saxsnorm)
            
        bg =  self.settings[detector]["bg"]
        if bg != False: 
            if os.path.isfile(bg):
                saxsbgs=BackgroundSubtraction(detector+"bg","ignored")
                sfh=ScanFileHolder()
                if (norm>=0):
                    upstream=detector+"norm.data"
                else:
                    upstream=realdetname+".data"
                sfh.load(NexusLoader(bg,[upstream]))
                ds=sfh.getAxis(upstream)
                saxsbgs.setBackground(ds)
                saxsrclist.add(saxsbgs)
            else:
                print "background file \"%s\" does not exist." % bg
        

        if (sect):
            if sroi != None:
#.........这里部分代码省略.........
开发者ID:openGDA,项目名称:gda-core,代码行数:103,代码来源:redux.py

示例2: plot_getbean

# 需要导入模块: from uk.ac.diamond.scisoft.analysis import SDAPlotter [as 别名]
# 或者: from uk.ac.diamond.scisoft.analysis.SDAPlotter import getGuiBean [as 别名]
def plot_getbean(name):
    jb = _plotter.getGuiBean(name)
    if jb is not None:
        return _wrap_gui_bean(jb, _guibean())
    return jb
开发者ID:erwindl0,项目名称:scisoft-core,代码行数:7,代码来源:jyplot.py

示例3: plot_getbean

# 需要导入模块: from uk.ac.diamond.scisoft.analysis import SDAPlotter [as 别名]
# 或者: from uk.ac.diamond.scisoft.analysis.SDAPlotter import getGuiBean [as 别名]
def plot_getbean(name):
    jb = _plotter.getGuiBean(name)
    _wrap_gui_bean(jb)
    return jb
开发者ID:DevasenaInupakutika,项目名称:scisoft-core,代码行数:6,代码来源:jyplot.py


注:本文中的uk.ac.diamond.scisoft.analysis.SDAPlotter.getGuiBean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。