Changeset 1399


Ignore:
Timestamp:
Jun 30, 2014 10:40:05 AM (7 years ago)
Author:
vondreele
Message:

allow D (&T) for hydrogen atom types
allow ge* for image extensions (as found at APS 1ID!)
switch e11 & e22 definitions to match coordinate system (x horizontal, y vertical)
add subtraction of dark image for image display & strain fitting
skip images with no strain entries in fitallstrsta

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ElementTable.py

    r955 r1399  
    2020White = (255, 255, 255)           
    2121ElTable = [
    22 #    (["D","D-1"],                  0,0, "Deuterium",   White,           0.0000,(255,255,255)),
    23 #    (["T","T-1"],                  0,0, "Tritium",     White,           0.0000,(255,255,255)),
    2422    (["H","H-1","D","D-1","T","T-1"],0,0, "Hydrogen",    White,           0.0000,(255,255,255)),
     23    (["D","D-1"],                  0,0, "Deuterium",   White,           0.0000,(255,255,255)),
     24    (["T","T-1"],                  0,0, "Tritium",     White,           0.0000,(255,255,255)),
    2525    (["He",],                     17,0, "Helium",      Noblecolor,      0.0000,(217,255,255)),
    2626    (["Li","Li+1"],                0,1, "Lithium",     Alkcolor,        0.0004,(204,128,255)),
  • trunk/GSASII.py

    r1397 r1399  
    20412041        dlg = wx.FileDialog(
    20422042            self, 'Choose image files', '.', '',
    2043             'Any supported image file (*.edf;*.tif;*.tiff;*.mar*;*.avg;*.sum;*.img;*.G2img;*.png)|'
    2044             '*.edf;*.tif;*.tiff;*.mar*;*.avg;*.sum;*.img;*.G2img;*.png;*.zip|'
     2043            'Any supported image file (*.edf;*.tif;*.tiff;*.mar*;*.ge*;*.avg;*.sum;*.img;*.G2img;*.png)|'
     2044            '*.edf;*.tif;*.tiff;*.mar*;*.ge*;*.avg;*.sum;*.img;*.G2img;*.png;*.zip|'
    20452045            'European detector file (*.edf)|*.edf|'
    20462046            'Any detector tif (*.tif;*.tiff)|*.tif;*.tiff|'
    20472047            'MAR file (*.mar*)|*.mar*|'
    2048             'GE Image (*.avg;*.sum)|*.avg;*.sum|'
     2048            'GE Image (*.ge*;*.avg;*.sum)|*.ge*;*.avg;*.sum|'
    20492049            'ADSC Image (*.img)|*.img|'
    20502050            'GSAS-II Image (*.G2img)|*.G2img|'
  • trunk/GSASIIIO.py

    r1397 r1399  
    138138    if not ospath.exists(imagefile):
    139139        dlg = wx.FileDialog(G2frame, 'Bad image file name; choose name', '.', '',\
    140         'Any image file (*.edf;*.tif;*.tiff;*.mar*;*.avg;*.sum;*.img)\
    141         |*.edf;*.tif;*.tiff;*.mar*;*.avg;*.sum;*.img|\
     140        'Any image file (*.edf;*.tif;*.tiff;*.mar*;*.ge*;*.avg;*.sum;*.img)\
     141        |*.edf;*.tif;*.tiff;*.mar*;*.ge*;*.avg;*.sum;*.img|\
    142142        European detector file (*.edf)|*.edf|\
    143143        Any detector tif (*.tif;*.tiff)|*.tif;*.tiff|\
    144144        MAR file (*.mar*)|*.mar*|\
    145         GE Image (*.avg;*.sum)|*.avg;*.sum|\
     145        GE Image (*.ge*;*.avg;*.sum)|*.ge*;*.avg;*.sum|\
    146146        ADSC Image (*.img)|*.img|\
    147147        All files (*.*)|*.*',wx.OPEN|wx.CHANGE_DIR)
     
    262262    elif ext == '.mar3450' or ext == '.mar2300':
    263263        Comments,Data,Npix,Image = GetMAR345Data(imagefile)
    264     elif ext in ['.sum','.avg','']:
     264    elif ext in ['.sum','.avg'] or 'ge' in ext:
    265265        Comments,Data,Npix,Image = GetGEsumData(imagefile)
    266266    elif ext == '.G2img':
     
    366366        head = ['GE detector sum data from APS 1-ID',]
    367367        sizexy = [2048,2048]
    368     elif '.avg' in filename:
    369         head = ['GE detector avg data from APS 1-ID',]
     368    elif '.avg' in filename or '.ge' in filename:
     369        head = ['GE detector avg or ge* data from APS 1-ID',]
    370370        sizexy = [2048,2048]
    371371    else:
     
    379379    if '.sum' in filename:
    380380        image = np.array(ar.array('f',File.read(4*Npix)),dtype=np.int32)
    381     elif '.avg' in filename:
     381    elif '.avg' in filename or '.ge' in filename:
    382382        image = np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32)
    383383    else:
  • trunk/GSASIIimage.py

    r1394 r1399  
    972972    for ring in StrSta['d-zero']:
    973973        Eij = ring['Emat']
    974         E = [[Eij[0],Eij[1],0],[Eij[1],Eij[2],0],[0,0,0]]
     974        E = [[Eij[2],Eij[1],0],[Eij[1],Eij[0],0],[0,0,0]]
    975975        th,azm = ring['ImtaObs']
    976976        th0 = np.ones_like(azm)*npasind(wave/(2.*ring['Dset']))
     
    10231023       
    10241024    def strainCalc(p,xyd,dset,wave,phi,StaType):
    1025         E = np.array([[p[0],p[1],0],[p[1],p[2],0],[0,0,0]])
     1025        E = np.array([[p[2],p[1],0],[p[1],p[0],0],[0,0,0]])
    10261026        dspo,azm,dsp = xyd
    10271027        th = npasind(wave/(2.0*dspo))
  • trunk/GSASIIimgGUI.py

    r1392 r1399  
    777777        def OnDarkImage(event):
    778778            data['dark image'][0] = darkImage.GetValue()
     779            G2plt.PlotExposedImage(G2frame,event=event)
    779780
    780781        def OnBackMult(event):
     
    793794                pass
    794795            darkMult.SetValue("%.3f" % (data['dark image'][1]))          #reset in case of error
     796            G2plt.PlotExposedImage(G2frame,event=event)
    795797       
    796798        backSizer = wx.FlexGridSizer(0,4,5,5)
     
    15231525                    names.append(choices[sel])
    15241526            dlg.Destroy()
    1525             SeqResult = {'histNames':names,}
     1527            SeqResult = {}
    15261528            dlg = wx.ProgressDialog('Sequential IMG Strain fit','Data set name = '+names[0],len(names),
    15271529                style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_REMAINING_TIME|wx.PD_CAN_ABORT)         
    15281530            wx.BeginBusyCursor()
     1531            goodnames = []
    15291532            try:
    15301533                for i,name in enumerate(names):
     
    15361539                    Controls = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,Id, 'Image Controls'))
    15371540                    StaCtrls = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,Id, 'Stress/Strain'))
     1541                    if not len(StaCtrls['d-zero']):
     1542                        continue
     1543                    goodnames.append(name)
    15381544                    id = G2gd.GetPatternTreeItemId(G2frame, G2frame.root, name)
    15391545                    Npix,imagefile = G2frame.PatternTree.GetItemPyData(Id)
    15401546                    image = G2IO.GetImageData(G2frame,imagefile,True)
     1547                    dark = Controls['dark image']
     1548                    if dark[0]:
     1549                        darkfile = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,
     1550                            G2frame.root,dark[0]))[1]
     1551                        darkImg = G2IO.GetImageData(G2frame,darkfile,imageOnly=True)
     1552                        image += dark[1]*darkImg
    15411553                    G2img.FitStrSta(image,StaCtrls,Controls)
    15421554                    G2plt.PlotStrain(G2frame,StaCtrls,newPlot=True)
     
    15541566                        'covMatrix':[],'title':name,'parmDict':parmDict}
    15551567                else:
     1568                    SeqResult['histNames'] = goodnames
    15561569                    dlg.Destroy()
    15571570                    print ' ***** Sequential strain refinement successful *****'
  • trunk/GSASIIplot.py

    r1397 r1399  
    28792879        pass
    28802880    size,imagefile = G2frame.PatternTree.GetItemPyData(G2frame.Image)
     2881    dark = Data['dark image']
     2882    if dark[0]:
     2883        darkfile = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,
     2884            G2frame.root,dark[0]))[1]
    28812885    if imagefile != G2frame.oldImagefile:
    28822886        imagefile = G2IO.CheckImageFile(G2frame,imagefile)
     
    28862890        G2frame.PatternTree.SetItemPyData(G2frame.Image,[size,imagefile])
    28872891        G2frame.ImageZ = G2IO.GetImageData(G2frame,imagefile,imageOnly=True)
     2892        if dark[0]:
     2893            darkImg = G2IO.GetImageData(G2frame,darkfile,imageOnly=True)
     2894            G2frame.ImageZ += dark[1]*darkImg
    28882895        G2frame.oldImagefile = imagefile
    28892896
Note: See TracChangeset for help on using the changeset viewer.