Changeset 1131


Ignore:
Timestamp:
Oct 30, 2013 4:00:33 PM (10 years ago)
Author:
vondreele
Message:

fix to read Chess A2 tiff files
add polarization correction to SASD type patterns (show as PWDR for now)
fix to polygon & frame selection

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r1127 r1131  
    477477            image = ar.array('L',File.read(4*Npix))
    478478            image = np.array(np.asarray(image),dtype=np.int32)
     479        else:
     480            if IFD[258][2][0] == 16:
     481                print sizexy
     482                tifType = 'GE'
     483                pixy = (200,200)
     484                File.seek(8)
     485                if not imageOnly:
     486                    print 'Read GE-detector tiff file: ',filename
     487                image = np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32)
     488           
    479489    elif 262 in IFD and IFD[262][2][0] > 4:
    480490        tifType = 'DND'
     
    503513                else:
    504514                    image = np.array(ar.array('I',File.read(4*Npix)),dtype=np.int32)
     515               
    505516        elif IFD[273][2][0] == 4096:
    506517            if sizexy[0] == 3072:
  • trunk/GSASIIimage.py

    r1121 r1131  
    808808        else:
    809809            H1 = LRazm
    810         H0[0] /= npcosd(H2[:-1])**2
     810        H0 /= npcosd(H2[:-1])**2
    811811        if data['Oblique'][1]:
    812             H0[0] /= G2pwd.Oblique(data['Oblique'][0],H2[:-1])
     812            H0 /= G2pwd.Oblique(data['Oblique'][0],H2[:-1])
     813        if 'SASD' in data['type'] and data['PolaVal'][1]:
     814            H0 /= np.array([G2pwd.Polarization(data['PolaVal'][0],H2[:-1],Azm=azm)[0] for azm in H1[:-1]+np.diff(H1)])
    813815        Nup += 1
    814816        dlg.Update(Nup)
  • trunk/GSASIIimgGUI.py

    r1128 r1131  
    253253        def OnDataType(event):
    254254            data['type'] = typeSel.GetValue()[:4]
     255            wx.CallAfter(UpdateImageControls,G2frame,data,masks)
    255256   
    256257        def OnNewColorBar(event):
     
    265266                pass
    266267            azmthOff.SetValue("%.2f"%(data['azmthOff']))          #reset in case of error 
     268            G2plt.PlotExposedImage(G2frame,event=event)
    267269       
    268270        comboSizer = wx.BoxSizer(wx.HORIZONTAL)
     
    523525            G2plt.PlotExposedImage(G2frame,event=event)
    524526               
    525         dataSizer = wx.FlexGridSizer(5,2,5,5)
     527        def OnApplyPola(event):
     528            if data['PolaVal'][1]:
     529                data['PolaVal'][1] = False
     530            else:
     531                data['PolaVal'][1] = True
     532               
     533        def OnPolaVal(event):
     534            try:
     535                value = float(polaVal.GetValue())
     536                if 0.001 <= value <= 0.999:
     537                    data['PolaVal'][0] = value
     538                else:
     539                    raise ValueError
     540            except ValueError:
     541                pass
     542            polaVal.SetValue('%.3f'%(data['PolaVal'][0]))
     543                           
     544        dataSizer = wx.FlexGridSizer(5,2,5,3)
    526545        dataSizer.Add(wx.StaticText(parent=G2frame.dataDisplay,label=' Integration coefficients'),0,
    527546            wx.ALIGN_CENTER_VERTICAL)   
     
    586605        littleSizer.Add(obliqVal,0,wx.ALIGN_CENTER_VERTICAL)
    587606        dataSizer.Add(littleSizer,0,)
     607        if 'SASD' in data['type']:
     608            littleSizer = wx.BoxSizer(wx.HORIZONTAL)
     609            setPolariz = wx.CheckBox(parent=G2frame.dataDisplay,label='Apply polarization?')
     610            dataSizer.Add(setPolariz,0,wx.ALIGN_CENTER_VERTICAL)
     611            setPolariz.Bind(wx.EVT_CHECKBOX, OnApplyPola)
     612            setPolariz.SetValue(data['PolaVal'][1])
     613            littleSizer.Add(wx.StaticText(G2frame.dataDisplay,label='Value (0.001-0.999)  '),0,
     614                wx.ALIGN_CENTER_VERTICAL)
     615            polaVal = wx.TextCtrl(parent=G2frame.dataDisplay,value='%.3f'%(data['PolaVal'][0]),
     616                style=wx.TE_PROCESS_ENTER)
     617            polaVal.Bind(wx.EVT_TEXT_ENTER,OnPolaVal)
     618            polaVal.Bind(wx.EVT_KILL_FOCUS,OnPolaVal)
     619            littleSizer.Add(polaVal,0,wx.ALIGN_CENTER_VERTICAL)
     620            dataSizer.Add(littleSizer,0,)
    588621       
    589622        showLines = wx.CheckBox(parent=G2frame.dataDisplay,label='Show integration limits?')
     
    772805    if 'Oblique' not in data:
    773806        data['Oblique'] = [0.5,False]
     807    if 'PolaVal' not in data:
     808        data['PolaVal'] = [0.99,False]
    774809    #end fix
    775810   
  • trunk/GSASIIplot.py

    r1128 r1131  
    22662266            elif G2frame.MaskKey =='p':
    22672267                polygon = Masks['Polygons'][-1]
    2268                 if len(polygon) > 2 and event.mouseevent.button == 3:
     2268                if len(polygon) > 2 and event.button == 3:
    22692269                    x0,y0 = polygon[0]
    22702270                    polygon.append([x0,y0])
     
    22762276            elif G2frame.MaskKey =='f':
    22772277                frame = Masks['Frames']
    2278                 if len(frame) > 2 and event.mouseevent.button == 3:
     2278                if len(frame) > 2 and event.button == 3:
    22792279                    x0,y0 = frame[0]
    22802280                    frame.append([x0,y0])
  • trunk/GSASIIpwd.py

    r1073 r1131  
    163163   
    164164def Oblique(ObCoeff,Tth):
    165     'needs a doc string'
     165    'currently assumes detector is normal to beam'
    166166    if ObCoeff:
    167167        return (1.-ObCoeff)/(1.0-np.exp(np.log(ObCoeff)/npcosd(Tth)))
Note: See TracChangeset for help on using the changeset viewer.