Changeset 98


Ignore:
Timestamp:
Jul 1, 2010 11:32:40 AM (11 years ago)
Author:
vondreel
Message:

new fortran polymask used

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r94 r98  
    55import numpy as np
    66import numpy.linalg as nl
     7import GSASIIpath
    78import GSASIIplot as G2plt
    89import GSASIIlattice as G2lat
     
    460461def Make2ThetaAzimuthMap(data,masks,imageN):
    461462    import numpy.ma as ma
     463    import polymask as pm
    462464    #transforms 2D image from x,y space to 2-theta,azimuth space based on detector orientation
    463465    pixelSize = data['pixelSize']
     
    471473    polygons = masks['Polygons']
    472474    tam = ma.make_mask_none((imageN,imageN))
     475    for polygon in polygons:
     476        tamp = ma.make_mask_none((imageN*imageN))
     477        tam = ma.mask_or(tam.flatten(),ma.make_mask(pm.polymask(imageN*imageN,
     478            tax.flatten(),tay.flatten(),len(polygon),polygon,tamp)))
     479    tam = np.reshape(tam,(imageN,imageN))
    473480    for X,Y,diam in spots:
    474481        tam = ma.mask_or(tam,ma.getmask(ma.masked_less((tax-X)**2+(tay-Y)**2,(diam/2.)**2)))
    475     for polygon in polygons:
    476         tam = ma.mask_or(tam.flatten(),ma.make_mask([pointInPolygon(polygon,xy) for xy in zip(tax.flatten(),tay.flatten())]))
    477482    return GetTthAzm(tax,tay,data),tam           #2-theta & azimuth arrays & position mask
    478483
  • trunk/GSASIIimgGUI.py

    r94 r98  
    589589            spotText = wx.TextCtrl(parent=self.dataDisplay,value=("%.2f,%.2f" % (x,y)),
    590590                style=wx.TE_READONLY)
    591             spotTextazmText
     591            spotText.SetBackgroundColour(VERY_LIGHT_GREY)
    592592            littleSizer.Add(spotText,0,wx.ALIGN_CENTER_VERTICAL)
    593593            spotText.Bind(wx.EVT_ENTER_WINDOW,OnTextMsg)
Note: See TracChangeset for help on using the changeset viewer.