Esempio n. 1
0
    def __makeObjects(self):
        """Add interactors"""

        self.tbarSizer = makeTitleBar(self, 'Options for Multiring Rebin')

        self.ring_pan = ringPanel(self, wx.NewId())

        self.emin_lab = wx.StaticText(self, wx.NewId(),
                                      'Eta min',
                                      style=wx.ALIGN_RIGHT)
        self.emax_lab = wx.StaticText(self, wx.NewId(),
                                      'Eta max',
                                      style=wx.ALIGN_RIGHT)
        self.emin_txt = wx.TextCtrl(self, wx.NewId(),
                                    value='0',
                                    style=wx.RAISED_BORDER | wx.TE_PROCESS_ENTER)
        self.emax_txt = wx.TextCtrl(self, wx.NewId(),
                                    value='360',
                                    style=wx.RAISED_BORDER | wx.TE_PROCESS_ENTER)
        self.numEta_lab = wx.StaticText(self, wx.NewId(),
                                        'Number of Eta Bins',
                                         style=wx.ALIGN_RIGHT)
        self.numRho_lab = wx.StaticText(self, wx.NewId(),
                                        'Rho Bins Per Ring',
                                         style=wx.ALIGN_RIGHT)
        self.numEta_spn = wx.SpinCtrl(self, wx.NewId(), min=1, value=str(36) )
        self.numRho_spn = wx.SpinCtrl(self, wx.NewId(), min=1, value=str(20) )

        return
Esempio n. 2
0
    def __makeObjects(self):
        """Add interactors"""

        self.tbarSizer = makeTitleBar(self, 'Options for Multiring Rebin')

        self.ring_pan = ringPanel(self, wx.NewIdRef())

        self.emin_lab = wx.StaticText(self, wx.NewIdRef(),
                                      'Eta min',
                                      style=wx.ALIGN_RIGHT)
        self.emax_lab = wx.StaticText(self, wx.NewIdRef(),
                                      'Eta max',
                                      style=wx.ALIGN_RIGHT)
        self.emin_txt = wx.TextCtrl(self, wx.NewIdRef(),
                                    value='0',
                                    style=wx.RAISED_BORDER | wx.TE_PROCESS_ENTER)
        self.emax_txt = wx.TextCtrl(self, wx.NewIdRef(),
                                    value='360',
                                    style=wx.RAISED_BORDER | wx.TE_PROCESS_ENTER)
        self.numEta_lab = wx.StaticText(self, wx.NewIdRef(),
                                        'Number of Eta Bins',
                                         style=wx.ALIGN_RIGHT)
        self.numRho_lab = wx.StaticText(self, wx.NewIdRef(),
                                        'Rho Bins Per Ring',
                                         style=wx.ALIGN_RIGHT)
        self.numEta_spn = wx.SpinCtrl(self, wx.NewIdRef(), min=1, value=str(36) )
        self.numRho_spn = wx.SpinCtrl(self, wx.NewIdRef(), min=1, value=str(20) )

        return
Esempio n. 3
0
    def __makeObjects(self):
        """Add interactors"""
        #
        exp = wx.GetApp().ws
        #
        #  Titlebar
        #
        self.tbarSizer = makeTitleBar(self, 'Detector Calibration')
        #
        #  Material Selection
        #
        self.mats_lab = wx.StaticText(self, wx.NewId(),
                                        'Active Material', style=wx.ALIGN_CENTER)
        self.mats_cho = wx.Choice(self, wx.NewId(),
                                  choices=[m.name for m in exp.matList])
        #
        #  Rings panel
        #
        self.ring_pan = ringPanel(self, wx.NewId())
        #
        #  II.  Geometry
        #
        #  Will have a checkbox and a spin control for each parameter.
        #
        self.detLabSizer = makeTitleBar(self, 'Detector Parameters',
                                        color=WP.TITLEBAR_BG_COLOR_PANEL1)
        deltaBoxTip = "Use this box to set the increment for the spinner to the left"
        app = wx.GetApp()
        det = app.ws.detector

        self.nrows_txt = wx.TextCtrl(self, wx.NewId(), value=str(det.nrows), style=wx.RAISED_BORDER)
        self.ncols_txt = wx.TextCtrl(self, wx.NewId(), value=str(det.ncols), style=wx.RAISED_BORDER)
        self.pixel_txt = wx.TextCtrl(self, wx.NewId(), value=str(det.pixelPitch), style=wx.RAISED_BORDER)
        self.pixel_txt_s = wx.TextCtrl(self, wx.NewId(), value=str(det.pixelPitch), style=wx.RAISED_BORDER|wx.TE_READONLY)
        
        name = 'x Center'
        self.cbox_xc  = wx.CheckBox(self, wx.NewId(), name)
        self.float_xc = FloatControl(self, wx.NewId())
        self.float_xc.SetValue(det.xc)
        self.float_xc.SetDelta(0.5*det.pixelPitch)

        name = 'y Center'
        self.cbox_yc  = wx.CheckBox(self, wx.NewId(), name)
        self.float_yc = FloatControl(self, wx.NewId())
        self.float_yc.SetValue(det.yc)
        self.float_yc.SetDelta(0.5*det.pixelPitch)

        name = 'Distance'
        self.cbox_D  = wx.CheckBox(self, wx.NewId(), name)
        self.float_D = FloatControl(self, wx.NewId())
        self.float_D.SetValue(det.workDist)
        self.float_D.SetDelta(10*det.pixelPitch)

        name = 'x Tilt'
        self.cbox_xt  = wx.CheckBox(self, wx.NewId(), name)
        self.float_xt = FloatControl(self, wx.NewId())
        self.float_xt.SetValue(det.xTilt)

        name = 'y Tilt'
        self.cbox_yt  = wx.CheckBox(self, wx.NewId(), name)
        self.float_yt = FloatControl(self, wx.NewId())
        self.float_yt.SetValue(det.yTilt)

        name = 'z Tilt'
        self.cbox_zt  = wx.CheckBox(self, wx.NewId(), name)
        self.float_zt = FloatControl(self, wx.NewId())
        self.float_zt.SetValue(det.zTilt)

        name = 'chi Tilt'
        self.cbox_ct  = wx.CheckBox(self, wx.NewId(), name)
        self.float_ct = FloatControl(self, wx.NewId())
        self.float_ct.SetValue(det.chiTilt)

        #
        #  Distortion parameters
        #
        #  *) NOTE THAT THESE ARE SPECIFIC FOR THE GE
        #  *) must break these out into a subpanel, as the
        #     number (if any at all) will change for each
        #     detector type.
        name = 'p0'
        self.cbox_d1  = wx.CheckBox(self, wx.NewId(), name)
        self.float_d1 = FloatControl(self, wx.NewId())
        self.float_d1.SetValue(det.dparms[0])

        name = 'p1'
        self.cbox_d2  = wx.CheckBox(self, wx.NewId(), name)
        self.float_d2 = FloatControl(self, wx.NewId())
        self.float_d2.SetValue(det.dparms[1])

        name = 'p2'
        self.cbox_d3  = wx.CheckBox(self, wx.NewId(), name)
        self.float_d3 = FloatControl(self, wx.NewId())
        self.float_d3.SetValue(det.dparms[2])

        name = 'n0'
        self.cbox_d4  = wx.CheckBox(self, wx.NewId(), name)
        self.float_d4 = FloatControl(self, wx.NewId())
        self.float_d4.SetValue(det.dparms[3])

        name = 'n1'
        self.cbox_d5  = wx.CheckBox(self, wx.NewId(), name)
        self.float_d5 = FloatControl(self, wx.NewId())
        self.float_d5.SetValue(det.dparms[4])

        name = 'n2'
        self.cbox_d6  = wx.CheckBox(self, wx.NewId(), name)
        self.float_d6 = FloatControl(self, wx.NewId())
        self.float_d6.SetValue(det.dparms[5])
        #
        #  Fitting method
        #
        self.fitLabelSizer = makeTitleBar(self, 'Fitting Method',
                                          color=WP.TITLEBAR_BG_COLOR_PANEL1)
        self.fitDir_rb = wx.RadioButton(self, wx.NewId(), 'Direct Fit',
                                       style=wx.RB_GROUP)
        self.fitBin_rb = wx.RadioButton(self, wx.NewId(), 'Binned Fit')
        #
        #  III. Caking
        #
        self.numEta_lab = wx.StaticText(self, wx.NewId(),
                                        'Azimuthal bins',
                                         style=wx.ALIGN_RIGHT)
        self.numRho_lab = wx.StaticText(self, wx.NewId(),
                                        'Radial bins per ring',
                                         style=wx.ALIGN_RIGHT)
        self.numEta_spn = wx.SpinCtrl(self, wx.NewId(), min=12, initial=36)
        self.numRho_spn = wx.SpinCtrl(self, wx.NewId(), min=10, initial=20)
        #
        #  Fit button with options (at some point)
        #
        self.runFit_but  = wx.Button(self, wx.NewId(), 'Run Fit')

        return
Esempio n. 4
0
    def __makeObjects(self):
        """Add interactors"""
        exp = wx.GetApp().ws
        mat = exp.activeMaterial

        self.__makeTitleBar('Materials')
        #
        #  ========== Header
        #
        #  Material List
        #
        self.curr_lab = wx.StaticText(self, wx.NewId(),
                                        'Active Material', style=wx.ALIGN_CENTER)
        self.mats_cho = wx.Choice(self, wx.NewId(),
                                  choices=[m.name for m in exp.matList])
        self.new_but  = wx.Button(self, wx.NewId(), 'New Material')
        #
        #  Material Name
        #
        self.name_lab = wx.StaticText(self, wx.NewId(),
                                        'MATERIAL NAME', style=wx.ALIGN_CENTER)
        self.name_txt = wx.TextCtrl(self, wx.NewId(), value=Material.DFLT_NAME,
                                      style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)
        #
        #  Rings panel
        #
        self.ring_pan = ringPanel(self, wx.NewId())
        #
        #  Categories
        #
        #  ========== Lattice Params
        #
        self.lp_a_lab = wx.StaticText(self, wx.NewId(), 'a', style=wx.ALIGN_CENTER)
        self.lp_a_txt = wx.TextCtrl(self, wx.NewId(), value='0',
                                    style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        self.lp_b_lab = wx.StaticText(self, wx.NewId(), 'b', style=wx.ALIGN_CENTER)
        self.lp_b_txt = wx.TextCtrl(self, wx.NewId(), value='0',
                                    style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        self.lp_c_lab = wx.StaticText(self, wx.NewId(), 'c', style=wx.ALIGN_CENTER)
        self.lp_c_txt = wx.TextCtrl(self, wx.NewId(), value='0',
                                    style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        self.alpha_lab = wx.StaticText(self, wx.NewId(), 'alpha', style=wx.ALIGN_CENTER)
        self.alpha_txt = wx.TextCtrl(self, wx.NewId(), value='90',
                                     style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        self.beta_lab = wx.StaticText(self, wx.NewId(), 'beta', style=wx.ALIGN_CENTER)
        self.beta_txt = wx.TextCtrl(self, wx.NewId(), value='90',
                                    style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        self.gamma_lab = wx.StaticText(self, wx.NewId(), 'gamma', style=wx.ALIGN_CENTER)
        self.gamma_txt = wx.TextCtrl(self, wx.NewId(), value='90',
                                     style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        self.units_lab  = wx.StaticText(self, wx.NewId(), 'UNITS', style=wx.ALIGN_CENTER)
        self.dunits_cho = wx.Choice(self, wx.NewId(), choices=['angstroms'])
        self.dunits_cho.SetSelection(0)
        self.aunits_cho = wx.Choice(self, wx.NewId(), choices=['degrees'])
        self.aunits_cho.SetSelection(0)
        #
        #  Save list of lattice parameter windows.
        #
        self.lpWins = [self.lp_a_txt,  self.lp_b_txt, self.lp_c_txt,
                       self.alpha_txt, self.beta_txt, self.gamma_txt]
        self.wDict = {
            0: self.lp_a_txt,
            1: self.lp_b_txt,
            2: self.lp_c_txt,
            3: self.alpha_txt,
            4: self.beta_txt,
            5: self.gamma_txt
            }

        #
        #  ========== Space group info
        #
        self.sg_lab = wx.StaticText(self, wx.NewId(), 'Space Group',
                                    style=wx.ALIGN_CENTER)
        self.sg_spn = wx.SpinCtrl(self, wx.NewId(), min=1, max=230, initial=mat.spaceGroup.sgnum)

        self.hall_lab = wx.StaticText(self, wx.NewId(), 'Hall Symbol',
                                      style=wx.ALIGN_CENTER)
        self.hall_txt = wx.TextCtrl(self, wx.NewId(), value='',
                                    style=wx.RAISED_BORDER|wx.TE_READONLY)

        self.herm_lab = wx.StaticText(self, wx.NewId(), 'Hermann-Mauguin',
                                      style=wx.ALIGN_CENTER)
        self.herm_txt = wx.TextCtrl(self, wx.NewId(), value='',
                                    style=wx.RAISED_BORDER|wx.TE_READONLY)

        self.laue_lab = wx.StaticText(self, wx.NewId(), 'Laue Group',
                                      style=wx.ALIGN_CENTER)
        self.laue_txt = wx.TextCtrl(self, wx.NewId(), value='',
                                    style=wx.RAISED_BORDER|wx.TE_READONLY)

        self.ltype_lab = wx.StaticText(self, wx.NewId(), 'Lattice Type',
                                       style=wx.ALIGN_CENTER)
        self.ltype_txt = wx.TextCtrl(self, wx.NewId(), value='',
                                     style=wx.RAISED_BORDER|wx.TE_READONLY)

        self.hkls_lab = wx.StaticText(self, wx.NewId(), 'HKLs Max (sum of squares)',
                                      style=wx.ALIGN_CENTER)
        self.hkls_txt = wx.TextCtrl(self, wx.NewId(), value='10',
                                    style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        return
Esempio n. 5
0
    def __makeObjects(self):
        """Add interactors"""
        exp = wx.GetApp().ws
        mat = exp.activeMaterial

        self.__makeTitleBar('Materials')
        #
        #  ========== Header
        #
        #  Material List
        #
        self.curr_lab = wx.StaticText(self, wx.NewId(),
                                        'Active Material', style=wx.ALIGN_CENTER)
        self.mats_cho = wx.Choice(self, wx.NewId(),
                                  choices=[m.name for m in exp.matList])
        self.new_but  = wx.Button(self, wx.NewId(), 'New Material')
        #
        #  Material Name
        #
        self.name_lab = wx.StaticText(self, wx.NewId(),
                                        'MATERIAL NAME', style=wx.ALIGN_CENTER)
        self.name_txt = wx.TextCtrl(self, wx.NewId(), value=Material.DFLT_NAME,
                                      style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)
        #
        #  Rings panel
        #
        self.ring_pan = ringPanel(self, wx.NewId())
        #
        #  Categories
        #
        #  ========== Lattice Params
        #
        self.lp_a_lab = wx.StaticText(self, wx.NewId(), 'a', style=wx.ALIGN_CENTER)
        self.lp_a_txt = wx.TextCtrl(self, wx.NewId(), value='0',
                                    style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        self.lp_b_lab = wx.StaticText(self, wx.NewId(), 'b', style=wx.ALIGN_CENTER)
        self.lp_b_txt = wx.TextCtrl(self, wx.NewId(), value='0',
                                    style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        self.lp_c_lab = wx.StaticText(self, wx.NewId(), 'c', style=wx.ALIGN_CENTER)
        self.lp_c_txt = wx.TextCtrl(self, wx.NewId(), value='0',
                                    style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        self.alpha_lab = wx.StaticText(self, wx.NewId(), 'alpha', style=wx.ALIGN_CENTER)
        self.alpha_txt = wx.TextCtrl(self, wx.NewId(), value='90',
                                     style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        self.beta_lab = wx.StaticText(self, wx.NewId(), 'beta', style=wx.ALIGN_CENTER)
        self.beta_txt = wx.TextCtrl(self, wx.NewId(), value='90',
                                    style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        self.gamma_lab = wx.StaticText(self, wx.NewId(), 'gamma', style=wx.ALIGN_CENTER)
        self.gamma_txt = wx.TextCtrl(self, wx.NewId(), value='90',
                                     style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        self.units_lab  = wx.StaticText(self, wx.NewId(), 'UNITS', style=wx.ALIGN_CENTER)
        self.dunits_cho = wx.Choice(self, wx.NewId(), choices=['angstroms'])
        self.dunits_cho.SetSelection(0)
        self.aunits_cho = wx.Choice(self, wx.NewId(), choices=['degrees'])
        self.aunits_cho.SetSelection(0)
        #
        #  Save list of lattice parameter windows.
        #
        self.lpWins = [self.lp_a_txt,  self.lp_b_txt, self.lp_c_txt,
                       self.alpha_txt, self.beta_txt, self.gamma_txt]
        self.wDict = {
            0: self.lp_a_txt,
            1: self.lp_b_txt,
            2: self.lp_c_txt,
            3: self.alpha_txt,
            4: self.beta_txt,
            5: self.gamma_txt
            }

        #
        #  ========== Space group info
        #
        self.sg_lab = wx.StaticText(self, wx.NewId(), 'Space Group',
                                    style=wx.ALIGN_CENTER)
        self.sg_spn = wx.SpinCtrl(self, wx.NewId(), min=1, max=230, initial=mat.spaceGroup.sgnum)

        self.hall_lab = wx.StaticText(self, wx.NewId(), 'Hall Symbol',
                                      style=wx.ALIGN_CENTER)
        self.hall_txt = wx.TextCtrl(self, wx.NewId(), value='',
                                    style=wx.RAISED_BORDER|wx.TE_READONLY)

        self.herm_lab = wx.StaticText(self, wx.NewId(), 'Hermann-Mauguin',
                                      style=wx.ALIGN_CENTER)
        self.herm_txt = wx.TextCtrl(self, wx.NewId(), value='',
                                    style=wx.RAISED_BORDER|wx.TE_READONLY)

        self.laue_lab = wx.StaticText(self, wx.NewId(), 'Laue Group',
                                      style=wx.ALIGN_CENTER)
        self.laue_txt = wx.TextCtrl(self, wx.NewId(), value='',
                                    style=wx.RAISED_BORDER|wx.TE_READONLY)

        self.ltype_lab = wx.StaticText(self, wx.NewId(), 'Lattice Type',
                                       style=wx.ALIGN_CENTER)
        self.ltype_txt = wx.TextCtrl(self, wx.NewId(), value='',
                                     style=wx.RAISED_BORDER|wx.TE_READONLY)

        self.hkls_lab = wx.StaticText(self, wx.NewId(), 'HKLs Max (sum of squares)',
                                      style=wx.ALIGN_CENTER)
        self.hkls_txt = wx.TextCtrl(self, wx.NewId(), value='10',
                                    style=wx.RAISED_BORDER|wx.TE_PROCESS_ENTER)

        return