Changeset 4570 for trunk/GSASIIimgGUI.py


Ignore:
Timestamp:
Sep 16, 2020 9:04:32 PM (3 years ago)
Author:
vondreele
Message:

Implement arc mask method for determining polarization with scipy minimize_scalar method to find minimum difference between arc mask on/mask off integrations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimgGUI.py

    r4546 r4570  
    136136        G2plt.PlotExposedImage(G2frame,newPlot=True,event=tc.event)
    137137       
    138     #G2frame.dataWindow.ClearData()
     138    def OnPolaCalib(event):
     139        IOtth = [data['IOtth'][0]+2.,data['IOtth'][1]-2.]
     140        dlg = G2G.SingleFloatDialog(G2frame,'Polarization test arc mask',
     141''' Do not use if pattern has uneven absorption
     142 Set 2-theta max in image controls to be fully inside image 
     143 Enter 2-theta position for arc mask (%.1f-%.1f) '''%(IOtth[0],IOtth[1]),IOtth[1],IOtth,format='%.2f')
     144        if dlg.ShowModal() == wx.ID_OK:
     145            arcTth = dlg.GetValue()
     146            G2fil.G2SetPrintLevel('none')
     147            G2img.DoPolaCalib(G2frame.ImageZ,data,arcTth)
     148            G2fil.G2SetPrintLevel('all')
     149            UpdateImageData(G2frame,data)
     150        dlg.Destroy()
     151       
     152    G2frame.dataWindow.ClearData()
    139153    G2frame.ImageZ = GetImageZ(G2frame,data)
    140154    mainSizer = G2frame.dataWindow.GetSizer()
     
    161175    distSizer.Add(G2G.ValidatedTxtCtrl(G2frame.dataWindow,data['PolaVal'],0,nDig=(10,4),
    162176        xmin=0.,xmax=1.,typeHint=float),0,WACV)
     177    polaCalib = wx.Button(G2frame.dataWindow,label='Calibrate?')
     178    polaCalib.Bind(wx.EVT_BUTTON,OnPolaCalib)
     179    distSizer.Add(polaCalib,0,WACV)
    163180    mainSizer.Add(distSizer,0)
    164181    if 'samplechangerpos' not in data or data['samplechangerpos'] is None:
    165182        data['samplechangerpos'] = 0.0
    166183    mainSizer.Add(wx.StaticText(G2frame.dataWindow,label='Sample changer position %.2f mm'%data['samplechangerpos']),0,WACV)
     184    G2frame.dataWindow.SetDataSize()
    167185
    168186################################################################################
Note: See TracChangeset for help on using the changeset viewer.