From 1c75198af597527cf073d42f133f3c8d27dea608 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 18 Mar 2020 13:44:39 +0100 Subject: [PATCH] do not document the obvious --- processing/post/DADF5_postResults.py | 6 ------ processing/post/DADF5toDREAM3D.py | 14 +++++--------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/processing/post/DADF5_postResults.py b/processing/post/DADF5_postResults.py index 7046b29f3..2d03f17a6 100755 --- a/processing/post/DADF5_postResults.py +++ b/processing/post/DADF5_postResults.py @@ -15,10 +15,6 @@ scriptID = ' '.join([scriptName,damask.version]) # -------------------------------------------------------------------- parser = argparse.ArgumentParser() -#ToDo: We need to decide on a way of handling arguments of variable lentght -#https://stackoverflow.com/questions/15459997/passing-integer-lists-to-python - -#parser.add_argument('--version', action='version', version='%(prog)s {}'.format(scriptID)) parser.add_argument('filenames', nargs='+', help='DADF5 files') parser.add_argument('-d','--dir', dest='dir',default='postProc',metavar='string', @@ -33,8 +29,6 @@ options = parser.parse_args() if options.mat is None: options.mat=[] if options.con is None: options.con=[] -# --- loop over input files ------------------------------------------------------------------------ - for filename in options.filenames: results = damask.Result(filename) diff --git a/processing/post/DADF5toDREAM3D.py b/processing/post/DADF5toDREAM3D.py index 7d03e3aa2..64e098a58 100755 --- a/processing/post/DADF5toDREAM3D.py +++ b/processing/post/DADF5toDREAM3D.py @@ -48,10 +48,12 @@ Phase_types = {'Primary': 0} #further additions to these can be done by looking # MAIN # -------------------------------------------------------------------- parser = argparse.ArgumentParser(description='Creating a file for DREAM3D from DAMASK data') -parser.add_argument('filenames',nargs='+',help='HDF5 based output file') -parser.add_argument('--inc',nargs='+',help='Increment for which DREAM3D to be used, eg. 25',type=int) +parser.add_argument('filenames', nargs='+', + help='DADF5 files') parser.add_argument('-d','--dir', dest='dir',default='postProc',metavar='string', - help='name of subdirectory to hold output') + help='name of subdirectory relative to the location of the DADF5 file to hold output') +parser.add_argument('--inc',nargs='+', + help='Increment for which DREAM3D to be used, eg. 25',type=int) options = parser.parse_args() @@ -78,10 +80,8 @@ for filename in options.filenames: data_container_label = 'DataContainers/ImageDataContainer' cell_data_label = data_container_label + '/CellData' - # Phase information of DREAM.3D is constituent ID in DAMASK o[cell_data_label + '/Phases'] = f.get_constituent_ID().reshape(tuple(f.grid)+(1,)) - # Data quaternions DAMASK_quaternion = f.read_dataset(f.get_dataset_location('orientation')) # Convert: DAMASK uses P = -1, DREAM.3D uses P = +1. Also change position of imagninary part DREAM_3D_quaternion = np.hstack((-DAMASK_quaternion['x'],-DAMASK_quaternion['y'],-DAMASK_quaternion['z'], @@ -97,12 +97,10 @@ for filename in options.filenames: o[cell_data_label + group].attrs['DataArrayVersion'] = np.array([2],np.int32) o[cell_data_label + group].attrs['Tuple Axis Dimensions'] = 'x={},y={},z={}'.format(*f.grid) - # phase attributes o[cell_data_label + '/Phases'].attrs['ComponentDimensions'] = np.array([1],np.uint64) o[cell_data_label + '/Phases'].attrs['ObjectType'] = 'DataArray' o[cell_data_label + '/Phases'].attrs['TupleDimensions'] = f.grid.astype(np.uint64) - # Quats attributes o[cell_data_label + '/Quats'].attrs['ComponentDimensions'] = np.array([4],np.uint64) o[cell_data_label + '/Quats'].attrs['ObjectType'] = 'DataArray' o[cell_data_label + '/Quats'].attrs['TupleDimensions'] = f.grid.astype(np.uint64) @@ -127,8 +125,6 @@ for filename in options.filenames: o[ensemble_label+'/'+group].attrs['ObjectType'] = 'DataArray' o[ensemble_label+'/'+group].attrs['TupleDimensions'] = np.array([2],np.uint64) - - # Create geometry info geom_label = data_container_label + '/_SIMPL_GEOMETRY' o[geom_label + '/DIMENSIONS'] = np.int64(f.grid)