EBSDpython code
List of all members
ebsd.EBSD Class Reference

Detailed Description

Class to allow for read EBSD data.

Uses quaternions and symmetries but not orientations

Public Member Functions

INPUT METHODS
read input file <br>
initialize things<br>
.ang or .osc file format
  • Header: ASCII information starting with #
Parameters
fileNamefile name in the present directory
def __init__ (self, fileName, doctest=False)
 
def loadANG (self, fileName=None)
 Load .ang file: filename saved in self. More...
 
def loadTXT (self, fileName=None, update=False)
 read txt file and possibly update data. More...
 
def writeANG (self, fileName)
 write body of ang file More...
 
def loadOSC (self, fileName=None)
 
def loadCRC (self, fileName=None)
 
def loadVoid (self, rotation)
 rotation angles in degree More...
 
Mask and Path routines

masked areas are plotted in black.

Hence initially no point is part of the mask, i.e. all points are false

def maskCI (self, CI)
 masked all points off, which have a CI less than: good points=False, bad points=True More...
 
def maskReset (self)
 reset mask More...
 
def removePointsOutsideMask (self)
 set all data-points outside of mask to invalid such that after export to OIM, it will be read there as non-existing points More...
 
def setVMask (self, every=1)
 mask every kth point off, for fast plotting, does not influence results in any way More...
 
def cropVMask (self, xmin=None, ymin=None, xmax=None, ymax=None)
 crop visible area More...
 
def neighbors (self, idx=None, layers=1)
 identify neighboring indexes More...
 
def calcKAM (self, layers=1)
 calculate Kerner Average Misorientation in DEGREES (because user focused) More...
 
PLOT METHODS
given a class-vector, plot the vector as an image<br>
the x and y are given by the class-vector x and y
Parameters
vectorvector to be plotted as a 2D image
widthPixelrescale to horizontal size of the image [default: optimal pixel width]
vmaxrescale z-scale to maximal value
vminrescale z-scale to minimal value
interpolationTypeinterpolation type [default: "nearest" next-neighbor]
def plot (self, vector, widthPixel=None, vmax="", vmin="", interpolationType="nearest", cmap=None, show=True, cbar=True)
 
def plotRGB (self, rgb, widthPixel=256, interpolationType="nearest", fileName=None)
 
def plotIPF (self, direction="ND", widthPixel=None, fileName=None, interpolationType="nearest")
 plot Inverse Pole Figure (IPF) More...
 
def addSymbol (self, x, y, fileName=None, scale=1., colorCube='black')
 
def addScaleBar (self, fileName=None, site="BL", barLength=None, scale=-1, alpha=0.5)
 Add scale-bar to image. More...
 
def plotPF (self, axis=[1, points=False, fileName=None, color='#1f77b4', alpha=1.0, show=True, density=256, size=2, proj2D='up-left', vmin=0.0, vmax=1.0)
 plot pole figure More...
 

Constructor & Destructor Documentation

◆ __init__()

def ebsd.EBSD.__init__ (   self,
  fileName,
  doctest = False 
)

Member Function Documentation

◆ addScaleBar()

def ebsd.EBSD.addScaleBar (   self,
  fileName = None,
  site = "BL",
  barLength = None,
  scale = -1,
  alpha = 0.5 
)

Add scale-bar to image.

Parameters
fileNameif given, save to file
sitewhere to put the scale bar
bottom-left "BL" (default)
bottom-right "BR"
top-left "TL"
top-right "TR"
barLengthlength of scale bar. It is calculate if not given
scaleof font and rectangle. Default: widthInPixel / 16, which is for a 1024x786 image = 64
alphatransparency of scale bar background

◆ addSymbol()

def ebsd.EBSD.addSymbol (   self,
  x,
  y,
  fileName = None,
  scale = 1.,
  colorCube = 'black' 
)

◆ calcKAM()

def ebsd.EBSD.calcKAM (   self,
  layers = 1 
)

calculate Kerner Average Misorientation in DEGREES (because user focused)

Parameters
layersnumber of neighboring layers used for KAM (more: slower)

◆ cropVMask()

def ebsd.EBSD.cropVMask (   self,
  xmin = None,
  ymin = None,
  xmax = None,
  ymax = None 
)

crop visible area

Parameters
xminminimum x-coordinate
yminminimum y-coordinate
xmaxmaximum x-coordinate
ymaxmaximum y-coordinate

◆ loadANG()

def ebsd.EBSD.loadANG (   self,
  fileName = None 
)

Load .ang file: filename saved in self.

No need to use it

◆ loadCRC()

def ebsd.EBSD.loadCRC (   self,
  fileName = None 
)

◆ loadOSC()

def ebsd.EBSD.loadOSC (   self,
  fileName = None 
)

◆ loadTXT()

def ebsd.EBSD.loadTXT (   self,
  fileName = None,
  update = False 
)

read txt file and possibly update data.

Warning, this resets the mask to the one of the file

Update makes more sense if you have original data and update it with some partial information, since the partial information is incomplete (stepSize, width and height are in many cases wrong). Update will keep the old data and overwrite the new. THIS IS SLOWER THAN CREATING NEW

Parameters
fileNamefileName to load (partition data from OIM)
updateupdate data or read new (read-new: default)

◆ loadVoid()

def ebsd.EBSD.loadVoid (   self,
  rotation 
)

rotation angles in degree

◆ maskCI()

def ebsd.EBSD.maskCI (   self,
  CI 
)

masked all points off, which have a CI less than: good points=False, bad points=True

Parameters
CIcritical CI

◆ maskReset()

def ebsd.EBSD.maskReset (   self)

reset mask

◆ neighbors()

def ebsd.EBSD.neighbors (   self,
  idx = None,
  layers = 1 
)

identify neighboring indexes

Parameters
idxindex to find [if None: calculate all]
layersnumber of neighboring layers
Returns
array of neighbors; invalid points have a value=-10

◆ plot()

def ebsd.EBSD.plot (   self,
  vector,
  widthPixel = None,
  vmax = "",
  vmin = "",
  interpolationType = "nearest",
  cmap = None,
  show = True,
  cbar = True 
)

◆ plotIPF()

def ebsd.EBSD.plotIPF (   self,
  direction = "ND",
  widthPixel = None,
  fileName = None,
  interpolationType = "nearest" 
)

plot Inverse Pole Figure (IPF)

Parameters
directiondefault.."ND", "RD", "TD"
widthPixelhorizontal size of the image [default: optimal size based on data]
interpolationTypeinterpolation type [default: "nearest"]
fileNamesave to file instead of showing

◆ plotPF()

def ebsd.EBSD.plotPF (   self,
  axis = [1,
  points = False,
  fileName = None,
  color = '#1f77b4',
  alpha = 1.0,
  show = True,
  density = 256,
  size = 2,
  proj2D = 'up-left',
  vmin = 0.0,
  vmax = 1.0 
)

plot pole figure

Projection onto 2D: cooradinate systems are given as xDirection-yDirection (z follows)

  • down-right: [default in text books, mTex] RD = x = down; TD = y = right; ND = z = outOfPlane
  • up-left: [default in OIM and here] RD = x = up; TD = y = left; ND = z = outOfPlane
Parameters
axisaxis to plot: default: axis=1,0,0
pointsplot individual points [default], or plot distribution
fileNameif given, save to file
colorplot color
alphaalpha transparency
showshow figure [default], False for subsequent plotting
densityhow many points to plot on the distribution
sizepoints: point size; distribution: amount of smoothing: higher more smoothing
proj2Dorientation of 2D projection: [down-right, up-left, None]
vminminimum value plotted, used as cut-off for transparency
vmaxmax. used in color coding, allows to focus on minor texture

◆ plotRGB()

def ebsd.EBSD.plotRGB (   self,
  rgb,
  widthPixel = 256,
  interpolationType = "nearest",
  fileName = None 
)

◆ removePointsOutsideMask()

def ebsd.EBSD.removePointsOutsideMask (   self)

set all data-points outside of mask to invalid such that after export to OIM, it will be read there as non-existing points

◆ setVMask()

def ebsd.EBSD.setVMask (   self,
  every = 1 
)

mask every kth point off, for fast plotting, does not influence results in any way

Parameters
everyuse only every k-th point. Improves plotting speed. every=1 resets.

◆ writeANG()

def ebsd.EBSD.writeANG (   self,
  fileName 
)

write body of ang file

Parameters
fileNamefile name

The documentation for this class was generated from the following file: