Changeset 1049


Ignore:
Timestamp:
Sep 4, 2013 10:19:20 AM (10 years ago)
Author:
vondreele
Message:

fix mask copying errors & missing image data items
implement UserCalibrants?.py as additional image calibration input

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1048 r1049  
    13671367                            Data['calibrant'] = ''
    13681368                            Data['GonioAngles'] = [0.,0.,0.]
     1369                            Data['DetDepth'] = 0.
     1370                            Data['DetDepthRef'] = False
    13691371                        else:
    13701372                            Data['type'] = 'PWDR'
     
    13821384                            Data['ellipses'] = []
    13831385                            Data['GonioAngles'] = [0.,0.,0.]
     1386                            Data['DetDepth'] = 0.
     1387                            Data['DetDepthRef'] = False
    13841388                            Data['calibrant'] = ''
    13851389                            Data['IOtth'] = [2.0,5.0]
  • trunk/GSASIIimage.py

    r939 r1049  
    744744    import histogram2d as h2d
    745745    print 'Begin image integration'
     746    blkSize = 128               #this seems to be optimal
    746747    LUtth = data['IOtth']
    747748    LRazm = np.array(data['LRazimuth'],dtype=np.float64)
     
    756757    imageN = len(image)
    757758    Nx,Ny = data['size']
    758     nXBlks = (Nx-1)/1024+1
    759     nYBlks = (Ny-1)/1024+1
     759    nXBlks = (Nx-1)/blkSize+1
     760    nYBlks = (Ny-1)/blkSize+1
    760761    Nup = nXBlks*nYBlks*3+3
    761762    dlg = wx.ProgressDialog("Elapsed time","2D image integration",Nup,
     
    766767        dlg.Update(Nup)
    767768        for iBlk in range(nYBlks):
    768             iBeg = iBlk*1024
    769             iFin = min(iBeg+1024,Ny)
     769            iBeg = iBlk*blkSize
     770            iFin = min(iBeg+blkSize,Ny)
    770771            for jBlk in range(nXBlks):
    771                 jBeg = jBlk*1024
    772                 jFin = min(jBeg+1024,Nx)               
    773                 print 'Process map block:',iBlk,jBlk,' limits:',iBeg,iFin,jBeg,jFin
     772                jBeg = jBlk*blkSize
     773                jFin = min(jBeg+blkSize,Nx)               
     774#                print 'Process map block:',iBlk,jBlk,' limits:',iBeg,iFin,jBeg,jFin
    774775                TA,tam = Make2ThetaAzimuthMap(data,masks,(iBeg,iFin),(jBeg,jFin))           #2-theta & azimuth arrays & create position mask
    775776               
     
    784785                tax = np.where(tax < LRazm[0],tax+360.,tax)
    785786                NST,H0 = h2d.histogram2d(len(tax),tax,tay,taz,numAzms,numChans,LRazm,LUtth,Dazm,Dtth,NST,H0)
    786                 print 'block done'
     787#                print 'block done'
    787788                del tax,tay,taz
    788789                Nup += 1
  • trunk/GSASIIimgGUI.py

    r989 r1049  
    4545    '''
    4646    import ImageCalibrants as calFile
     47    try:
     48        import UserCalibrants as userFile
     49        calFile.Calibrants.update(userFile.Calibrants)
     50    except:
     51        pass
    4752#patch
    4853    if 'GonioAngles' not in data:
     
    918923                        Source = name
    919924                        Mask = copy.deepcopy(G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,id, 'Masks')))
    920                         del Mask['Thresholds']
    921925                    else:
    922926                        TextList.append([False,name,id])
     
    936940                        if ifcopy:
    937941                            mask = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,id, 'Masks'))
     942                            Mask['Thresholds'][0] = mask['Thresholds'][0]
     943                            Mask['Thresholds'][1][1] = min(mask['Thresholds'][1][1],Mask['Thresholds'][1][1])
    938944                            mask.update(Mask)                               
    939945                            G2frame.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(G2frame,id, 'Masks'),copy.deepcopy(mask))
     
    964970                File = open(filename,'r')
    965971                save = {}
     972                oldThreshold = data['Thresholds'][0]
    966973                S = File.readline()
    967974                while S:
     
    972979                    if key in ['Points','Rings','Arcs','Polygons','Thresholds']:
    973980                        save[key] = eval(val)
     981                        if key == 'Thresholds':
     982                            save[key][0] = oldThreshold
     983                            save[key][1][1] = min(oldThreshold[1],save[key][1][1])
    974984                    S = File.readline()
    975985                data.update(save)
  • trunk/ImageCalibrants.py

    r939 r1049  
    1 '''
     1"""
    22*ImageCalibrants: Calibration Standards*
    33----------------------------------------
     
    66calibrations for image data.
    77
    8 '''
    9 #GSASII powder calibrants file; dictionary of substances commonly used for powder
    10 #calibrations. Each entry consists of:
    11 # 'name':(Bravais no,(a,b,c,alpha,beta,gamma),no. lines skipped,(dmin,pixLimit,cutOff)
    12 #Useful Bravais nos.: F-cubic=0,I-cubic=1,P-cubic=2,R3/m(hex)=3, P6=4, P4mmm=6
     8Create your own in file UserCalibrants.py following the format shown here;
     9if you use the same names given here your entries will replace the corresponding
     10ones given here.
     11Each entry consists of:
     12 'name':(Bravais no,(a,b,c,alpha,beta,gamma),no. lines skipped,(dmin,pixLimit,cutOff)
     13Useful Bravais nos.: F-cubic=0,I-cubic=1,P-cubic=2,R3/m(hex)=3, P6=4, P4mmm=6
     14"""
    1315Calibrants={
    1416'':([0,],[(0,0,0,0,0,0),],0,(0,0,0)),
Note: See TracChangeset for help on using the changeset viewer.