Changeset 4011


Ignore:
Timestamp:
May 31, 2019 8:25:10 PM (3 years ago)
Author:
toby
Message:

test if texture is set non-zero w/o appropriate histograms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r4000 r4011  
    67506750        def OnShOrder(event):
    67516751            Obj = event.GetEventObject()
    6752             textureData['Order'] = int(Obj.GetValue())
     6752            # the Kaduk test: is Texture appropriate? Look for a 2nd histogram
     6753            # of any type with differing setting angles from the 1st.
     6754            instArray = {}
     6755            if int(Obj.GetValue()) > 0:
     6756                for h in data['Histograms']:
     6757                    PatternId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,h)
     6758                    Inst = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,PatternId,'Instrument Parameters'))[0]
     6759                    Sample = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,PatternId,'Sample Parameters'))
     6760                    if Inst['Type'][1] in instArray:
     6761                        if instArray[Inst['Type'][1]] != [Sample['Chi'],Sample['Phi'],Sample['Omega']]:
     6762                            textureData['Order'] = int(Obj.GetValue())
     6763                            break
     6764                    else:
     6765                        instArray[Inst['Type'][1]] = [Sample['Chi'],Sample['Phi'],Sample['Omega']]
     6766                else:
     6767                    textureData['Order'] = 0
     6768                    wx.MessageBox('Incorrect use of Texture. Use preferred orientation (on data tab) unless you have multiple histograms taken with different orientations',
     6769                            caption='Texture Error',style=wx.ICON_EXCLAMATION)
     6770            else:
     6771                textureData['Order'] = 0
    67536772            textureData['SH Coeff'][1] = SetSHCoef()
    67546773            wx.CallLater(100,UpdateTexture)
Note: See TracChangeset for help on using the changeset viewer.