Example #1
0
def _imageNameResolver(param, startname):
    msname = labeltree.makePath(param.group['microstructure'].value)[0]
    if param.automatic():
        # The automatic name for an image created from orientation
        # data is the filename of the data, minus any directory path
        # or suffix that it might have.
        msobj = ooflib.common.microstructure.microStructures[msname].getObject()
        basename = os.path.splitext(os.path.split(
            orientmapdata.getOrientationMapFile(msobj))[1])[0]
    else:
        basename = startname
    return whoville.getClass('Image').uniqueName([msname, basename])
Example #2
0
def _imageNameResolver(param, startname):
    msname = labeltree.makePath(param.group['microstructure'].value)[0]
    if param.automatic():
        # The automatic name for an image created from orientation
        # data is the filename of the data, minus any directory path
        # or suffix that it might have.
        msobj = ooflib.common.microstructure.microStructures[msname].getObject()
        basename = os.path.splitext(os.path.split(
            orientmapdata.getOrientationMapFile(msobj))[1])[0]
    else:
        basename = startname
    return whoville.getClass('Image').uniqueName([msname, basename])
Example #3
0
def writeOrientationMap(datafile, mscontext):
    ms = mscontext.getObject()
    data = orientmapdata.getOrientationMap(mscontext.getObject())
    if data:
        filename = orientmapdata.getOrientationMapFile(ms)
        orientations = [data.angle(pt).abg() for pt in ms.coords()]
        datafile.startCmd(microstructureIO.micromenu.OrientationMap)
        datafile.argument('microstructure', ms.name())
        datafile.argument('filename', filename)
        datafile.argument('orientations', [[a.alpha(), a.beta(), a.gamma()]
                                           for a in orientations])
        datafile.endCmd()
Example #4
0
def _orientationmapinfo(microstructure):
    filename = orientmapdata.getOrientationMapFile(microstructure.getObject())
    if filename:
        direct, basename = os.path.split(filename)
        return 'Orientation Map file: ' + basename + '\ndirectory: ' + direct
    return 'Orientation Map file: <None>'
Example #5
0
def _orientationmapinfo(microstructure):
    filename = orientmapdata.getOrientationMapFile(microstructure.getObject())
    if filename:
        direct, basename = os.path.split(filename)
        return 'Orientation Map file: ' + basename + '\ndirectory: ' + direct
    return 'Orientation Map file: <None>'