diff --git a/processing/post/addCurl.py b/processing/post/addCurl.py index 31a918316..f5db77234 100755 --- a/processing/post/addCurl.py +++ b/processing/post/addCurl.py @@ -63,25 +63,25 @@ def curlFFT(geomdim,field): # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [ASCIItable(s)]', description = """ Add column(s) containing curl of requested column(s). Operates on periodic ordered three-dimensional data sets. -Deals with both vector- and tensor-valued fields. +Deals with both vector- and tensor fields. """, version = scriptID) -parser.add_option('-c','--coordinates', +parser.add_option('-p','--pos','--periodiccellcenter' dest = 'coords', type = 'string', metavar = 'string', - help = 'column label of coordinates [%default]') + help = 'label of coordinates [%default]') parser.add_option('-v','--vector', dest = 'vector', action = 'extend', metavar = '', - help = 'column label(s) of vector field values') + help = 'label(s) of vector field values') parser.add_option('-t','--tensor', dest = 'tensor', action = 'extend', metavar = '', - help = 'column label(s) of tensor field values') + help = 'label(s) of tensor field values') parser.set_defaults(coords = 'pos', ) @@ -91,7 +91,7 @@ parser.set_defaults(coords = 'pos', if options.vector is None and options.tensor is None: parser.error('no data column specified.') -# --- loop over input files ------------------------------------------------------------------------- +# --- loop over input files ------------------------------------------------------------------------ if filenames == []: filenames = [None] @@ -148,7 +148,7 @@ for name in filenames: maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') size = grid/np.maximum(np.ones(3,'d'), grid-1.0) * (maxcorner-mincorner) # size from edge to edge = dim * n/(n-1) - size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) + size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) # spacing for grid==1 equal to smallest among other ones # ------------------------------------------ process value field ----------------------------------- diff --git a/processing/post/addDivergence.py b/processing/post/addDivergence.py index 935f7d83a..52ec2df75 100755 --- a/processing/post/addDivergence.py +++ b/processing/post/addDivergence.py @@ -19,7 +19,7 @@ def divFFT(geomdim,field): div_fourier = np.empty(field_fourier.shape[0:len(np.shape(field))-1],'c16') # size depents on whether tensor or vector # differentiation in Fourier space - k_s=np.zeros([3],'i') + k_s = np.zeros([3],'i') TWOPIIMG = 2.0j*math.pi for i in xrange(grid[2]): k_s[0] = i @@ -49,25 +49,25 @@ def divFFT(geomdim,field): # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [ASCIItable(s)]', description = """ Add column(s) containing divergence of requested column(s). Operates on periodic ordered three-dimensional data sets. Deals with both vector- and tensor-valued fields. """, version = scriptID) -parser.add_option('-c','--coordinates', +parser.add_option('-p','--pos','--periodiccellcenter' dest = 'coords', type = 'string', metavar = 'string', - help = 'column label of coordinates [%default]') + help = 'label of coordinates [%default]') parser.add_option('-v','--vector', dest = 'vector', action = 'extend', metavar = '', - help = 'column label(s) of vector field values') + help = 'label(s) of vector field values') parser.add_option('-t','--tensor', dest = 'tensor', action = 'extend', metavar = '', - help = 'column label(s) of tensor field values') + help = 'label(s) of tensor field values') parser.set_defaults(coords = 'pos', ) diff --git a/processing/post/addGradient.py b/processing/post/addGradient.py index a741b3a70..7ef042044 100755 --- a/processing/post/addGradient.py +++ b/processing/post/addGradient.py @@ -14,6 +14,7 @@ def gradFFT(geomdim,field): grid = np.array(np.shape(field)[2::-1]) N = grid.prod() # field size n = np.array(np.shape(field)[3:]).prod() # data size + if n == 3: dataType = 'vector' elif n == 1: dataType = 'scalar' @@ -52,27 +53,27 @@ def gradFFT(geomdim,field): # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [ASCIItable(s)]', description = """ Add column(s) containing gradient of requested column(s). Operates on periodic ordered three-dimensional data sets. Deals with both vector- and scalar fields. """, version = scriptID) -parser.add_option('-c','--coordinates', +parser.add_option('-p','--pos','--periodiccellcenter' dest = 'coords', - type = 'string', metavar='string', - help = 'column heading for coordinates [%default]') + type = 'string', metavar = 'string', + help = 'label of coordinates [%default]') parser.add_option('-v','--vector', dest = 'vector', action = 'extend', metavar = '', - help = 'heading of columns containing vector field values') + help = 'label(s) of vector field values') parser.add_option('-s','--scalar', dest = 'scalar', action = 'extend', metavar = '', - help = 'heading of columns containing scalar field values') + help = 'label(s) of scalar field values') -parser.set_defaults(coords = 'ipinitialcoord', +parser.set_defaults(coords = 'pos', ) (options,filenames) = parser.parse_args() @@ -137,7 +138,7 @@ for name in filenames: maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') size = grid/np.maximum(np.ones(3,'d'), grid-1.0) * (maxcorner-mincorner) # size from edge to edge = dim * n/(n-1) - size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) + size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) # spacing for grid==1 equal to smallest among other ones # ------------------------------------------ process value field ----------------------------------- diff --git a/processing/pre/table_fromOIMgrainFile.py b/processing/pre/table_fromOIMgrainFile.py index 9937af8c1..d448ba896 100755 --- a/processing/pre/table_fromOIMgrainFile.py +++ b/processing/pre/table_fromOIMgrainFile.py @@ -19,9 +19,9 @@ Adds header to OIM grain file to make it accesible as ASCII table parser.add_option('-l', '--labels', dest = 'labels', - help = 'lables for requested columns') + help = 'lables of requested columns') -parser.set_defaults(labels = ['1_eulerangles','2_eulerangles','3_eulerangles', +parser.set_defaults(labels = ['1_euler','2_euler','3_euler', '1_pos','2_pos', 'IQ', 'CI', 'Fit', 'GrainID',], )