|
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
| |||||||||||
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
| |||||||||||
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... | |||||||||||
def ebsd.EBSD.__init__ | ( | self, | |
fileName, | |||
doctest = False |
|||
) |
def ebsd.EBSD.addScaleBar | ( | self, | |
fileName = None , |
|||
site = "BL" , |
|||
barLength = None , |
|||
scale = -1 , |
|||
alpha = 0.5 |
|||
) |
Add scale-bar to image.
fileName | if given, save to file |
site | where to put the scale bar bottom-left "BL" (default) bottom-right "BR" top-left "TL" top-right "TR" |
barLength | length of scale bar. It is calculate if not given |
scale | of font and rectangle. Default: widthInPixel / 16, which is for a 1024x786 image = 64 |
alpha | transparency of scale bar background |
def ebsd.EBSD.addSymbol | ( | self, | |
x, | |||
y, | |||
fileName = None , |
|||
scale = 1. , |
|||
colorCube = 'black' |
|||
) |
def ebsd.EBSD.calcKAM | ( | self, | |
layers = 1 |
|||
) |
calculate Kerner Average Misorientation in DEGREES (because user focused)
layers | number of neighboring layers used for KAM (more: slower) |
def ebsd.EBSD.cropVMask | ( | self, | |
xmin = None , |
|||
ymin = None , |
|||
xmax = None , |
|||
ymax = None |
|||
) |
crop visible area
xmin | minimum x-coordinate |
ymin | minimum y-coordinate |
xmax | maximum x-coordinate |
ymax | maximum y-coordinate |
def ebsd.EBSD.loadANG | ( | self, | |
fileName = None |
|||
) |
Load .ang file: filename saved in self.
No need to use it
def ebsd.EBSD.loadCRC | ( | self, | |
fileName = None |
|||
) |
def ebsd.EBSD.loadOSC | ( | self, | |
fileName = None |
|||
) |
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
fileName | fileName to load (partition data from OIM) |
update | update data or read new (read-new: default) |
def ebsd.EBSD.loadVoid | ( | self, | |
rotation | |||
) |
rotation angles in degree
def ebsd.EBSD.maskCI | ( | self, | |
CI | |||
) |
masked all points off, which have a CI less than: good points=False, bad points=True
CI | critical CI |
def ebsd.EBSD.maskReset | ( | self | ) |
reset mask
def ebsd.EBSD.neighbors | ( | self, | |
idx = None , |
|||
layers = 1 |
|||
) |
identify neighboring indexes
idx | index to find [if None: calculate all] |
layers | number of neighboring layers |
def ebsd.EBSD.plot | ( | self, | |
vector, | |||
widthPixel = None , |
|||
vmax = "" , |
|||
vmin = "" , |
|||
interpolationType = "nearest" , |
|||
cmap = None , |
|||
show = True , |
|||
cbar = True |
|||
) |
def ebsd.EBSD.plotIPF | ( | self, | |
direction = "ND" , |
|||
widthPixel = None , |
|||
fileName = None , |
|||
interpolationType = "nearest" |
|||
) |
plot Inverse Pole Figure (IPF)
direction | default.."ND", "RD", "TD" |
widthPixel | horizontal size of the image [default: optimal size based on data] |
interpolationType | interpolation type [default: "nearest"] |
fileName | save to file instead of showing |
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)
axis | axis to plot: default: axis=1,0,0 |
points | plot individual points [default], or plot distribution |
fileName | if given, save to file |
color | plot color |
alpha | alpha transparency |
show | show figure [default], False for subsequent plotting |
density | how many points to plot on the distribution |
size | points: point size; distribution: amount of smoothing: higher more smoothing |
proj2D | orientation of 2D projection: [down-right, up-left, None] |
vmin | minimum value plotted, used as cut-off for transparency |
vmax | max. used in color coding, allows to focus on minor texture |
def ebsd.EBSD.plotRGB | ( | self, | |
rgb, | |||
widthPixel = 256 , |
|||
interpolationType = "nearest" , |
|||
fileName = None |
|||
) |
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
def ebsd.EBSD.setVMask | ( | self, | |
every = 1 |
|||
) |
mask every kth point off, for fast plotting, does not influence results in any way
every | use only every k-th point. Improves plotting speed. every=1 resets. |
def ebsd.EBSD.writeANG | ( | self, | |
fileName | |||
) |
write body of ang file
fileName | file name |