Changeset 2684


Ignore:
Timestamp:
Feb 1, 2017 7:58:04 PM (5 years ago)
Author:
toby
Message:

Image Parameters: split menus, more xfer angles options

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrls.py

    r2656 r2684  
    13221322      the window and only entries matching the entered text are shown.
    13231323    :param dict extraOpts: a dict containing a entries of form label_i and value_i with extra
    1324       options to present to the user, where value_i is the default value. At present only bool
    1325       values are supported.
     1324      options to present to the user, where value_i is the default value.
     1325      Options are listed ordered by the value_i values.
    13261326    :param kw: optional keyword parameters for the wx.Dialog may
    13271327      be included such as size [which defaults to `(320,310)`] and
  • trunk/GSASIIgrid.py

    r2681 r2684  
    20722072        self.ImageMenu = wx.MenuBar()
    20732073        self.PrefillDataMenu(self.ImageMenu)
     2074       
    20742075        self.ImageEdit = wx.Menu(title='')
    2075         self.ImageMenu.Append(menu=self.ImageEdit, title='Operations')
     2076        self.ImageMenu.Append(menu=self.ImageEdit, title='Calibration')
    20762077        self.ImageEdit.Append(help='Calibrate detector by fitting to calibrant lines',
    20772078            id=wxID_IMCALIBRATE, kind=wx.ITEM_NORMAL,text='Calibrate')
     
    20802081        self.ImageEdit.Append(help='Recalibrate all images by fitting to calibrant lines',
    20812082            id=wxID_IMRECALIBALL, kind=wx.ITEM_NORMAL,text='Recalibrate all')           
    2082         self.ImageEdit.Append(help='Clear calibration data points and rings',id=wxID_IMCLEARCALIB,
    2083             kind=wx.ITEM_NORMAL,text='Clear calibration')
    2084         self.ImageEdit.Append(help='Integrate selected image',id=wxID_IMINTEGRATE,
     2083        self.ImageEdit.Append(help='Clear calibration data points and rings',
     2084            id=wxID_IMCLEARCALIB, kind=wx.ITEM_NORMAL,text='Clear calibration')
     2085       
     2086        ImageIntegrate = wx.Menu(title='')
     2087        self.ImageMenu.Append(menu=ImageIntegrate, title='Integration')
     2088        ImageIntegrate.Append(help='Integrate selected image',id=wxID_IMINTEGRATE,
    20852089            kind=wx.ITEM_NORMAL,text='Integrate')
    2086         self.ImageEdit.Append(help='Integrate all images selected from list',id=wxID_INTEGRATEALL,
     2090        ImageIntegrate.Append(help='Integrate all images selected from list',id=wxID_INTEGRATEALL,
    20872091            kind=wx.ITEM_NORMAL,text='Integrate all')
    2088         self.ImageEdit.Append(help='Copy image controls to other images',
     2092        ImageIntegrate.Append(help='Open Auto-integration window to integrate a series of images',
     2093            id=wxID_IMAUTOINTEG, kind=wx.ITEM_NORMAL,text='Auto Integrate')
     2094
     2095        ImageParams = wx.Menu(title='')
     2096        self.ImageMenu.Append(menu=ImageParams, title='Parms')
     2097        ImageParams.Append(help='Copy image controls to other images',
    20892098            id=wxID_IMCOPYCONTROLS, kind=wx.ITEM_NORMAL,text='Copy Controls')
    2090         self.ImageEdit.Append(help='Copy selected image controls to other images',
     2099        ImageParams.Append(help='Copy selected image controls to other images',
    20912100            id=wxID_IMCOPYSELECTED, kind=wx.ITEM_NORMAL,text='Copy Selected')
    2092         self.ImageEdit.Append(help='Save image controls to file',
     2101        ImageParams.Append(help='Save image controls to file',
    20932102            id=wxID_IMSAVECONTROLS, kind=wx.ITEM_NORMAL,text='Save Controls')
    2094         self.ImageEdit.Append(help='Save controls from selected images to file',
     2103        ImageParams.Append(help='Save controls from selected images to file',
    20952104            id=wxID_SAVESELECTEDCONTROLS, kind=wx.ITEM_NORMAL,text='Save Multiple Controls')
    2096         self.ImageEdit.Append(help='Load image controls from file',
     2105        ImageParams.Append(help='Load image controls from file',
    20972106            id=wxID_IMLOADCONTROLS, kind=wx.ITEM_NORMAL,text='Load Controls')
    2098         self.ImageEdit.Append(help='Transfer integration range for other detector distances',
     2107        ImageParams.Append(help='Transfer integration range for other detector distances',
    20992108            id=wxID_IMXFERCONTROLS, kind=wx.ITEM_NORMAL,text='Xfer angles')
    2100         self.ImageEdit.Append(help='Open Auto-integration window to integrate a series of images',
    2101             id=wxID_IMAUTOINTEG, kind=wx.ITEM_NORMAL,text='Auto Integrate')
     2109       
    21022110        self.PostfillDataMenu()
    21032111           
  • trunk/GSASIIimgGUI.py

    r2682 r2684  
    312312                    'calibskip','pixLimit','cutoff','calibdmin','Flat Bkg','varyList',
    313313                    'binType','SampleShape','PolaVal','SampleAbs','dark image','background image']
    314         keyText = [i+'='+str(data[i]) for i in keyList]
     314        keyList.sort(key=lambda s: s.lower())
     315        keyText = [i+' = '+str(data[i]) for i in keyList]
    315316        # sort both lists together, ordered by keyText
    316317        selectedKeys = []
     
    474475        Names.pop(Names.index(Source))
    475476        # select targets & do copy
    476         extraopts = {"label_1":"Xfer scaled calib d-min", "value_1":False}
     477        extraopts = {"label_1":"Xfer scaled calib d-min", "value_1":False,
     478                     "label_2":"Xfer scaled 2-theta min", "value_2":False,
     479                     "label_3":"Xfer scaled 2-theta max", "value_3":True,
     480                     }
    477481        dlg = G2G.G2MultiChoiceDialog(G2frame,'Xfer angles',
    478482                                      'Transfer integration range from '+Source+' to:',Names,
     
    480484        try:
    481485            if dlg.ShowModal() == wx.ID_OK:
    482                 #xferAng = lambda tth,dist1,dist2: asind(dist1 * sind(tth) / dist2)
     486                for i in '_1','_2','_3':
     487                    if extraopts['value'+i]: break
     488                else:
     489                    G2G.G2MessageBox(G2frame,'Nothing to do!')
     490                    return
    483491                xferAng = lambda tth,dist1,dist2: atand(dist1 * tand(tth) / dist2)
    484492                items = dlg.GetSelections()
     
    497505                    data = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,Id,'Image Controls'))
    498506                    dist1 = data['distance']
    499                     if ttmin0 < 1.0:
    500                         data['IOtth'] = [ttmin0,xferAng(ttmax0,dist0,dist1)]
    501                     else:
    502                         data['IOtth'] = [xferAng(ttmin0,dist0,dist1),xferAng(ttmax0,dist0,dist1)]
     507                    if extraopts["value_2"]:
     508                        data['IOtth'][0] = xferAng(ttmin0,dist0,dist1)
     509                    if extraopts["value_3"]:
     510                        data['IOtth'][1] = xferAng(ttmax0,dist0,dist1)
    503511                    if extraopts["value_1"]:
    504512                        ang1 = xferAng(2.0*asind(wave0/(2.*dsp0)),dist0,dist1)
Note: See TracChangeset for help on using the changeset viewer.