following Rowenhorst convention

This commit is contained in:
Martin Diehl 2019-03-09 19:58:17 +01:00
parent 8bc6a64bf9
commit 433281f71d
2 changed files with 9 additions and 12 deletions

View File

@ -43,12 +43,12 @@ parser.add_option('-R',
'--labrotation', '--labrotation',
dest='labrotation', dest='labrotation',
type = 'float', nargs = 4, metavar = ' '.join(['float']*4), type = 'float', nargs = 4, metavar = ' '.join(['float']*4),
help = 'angle and axis of additional lab frame rotation [%default]') help = 'axis and angle of additional lab frame rotation [%default]')
parser.add_option('-r', parser.add_option('-r',
'--crystalrotation', '--crystalrotation',
dest='crystalrotation', dest='crystalrotation',
type = 'float', nargs = 4, metavar = ' '.join(['float']*4), type = 'float', nargs = 4, metavar = ' '.join(['float']*4),
help = 'angle and axis of additional crystal frame rotation [%default]') help = 'axis and angle of additional crystal frame rotation [%default]')
parser.add_option('--eulers', parser.add_option('--eulers',
dest = 'eulers', dest = 'eulers',
metavar = 'string', metavar = 'string',
@ -79,8 +79,8 @@ parser.add_option('-z',
help = 'label of lab z vector (expressed in crystal coords)') help = 'label of lab z vector (expressed in crystal coords)')
parser.set_defaults(output = [], parser.set_defaults(output = [],
labrotation = (0.,1.,0.,0.), # no rotation about 1,0,0 labrotation = (1.,1.,1.,0.), # no rotation about (1,1,1)
crystalrotation = (0.,1.,0.,0.), # no rotation about 1,0,0 crystalrotation = (1.,1.,1.,0.), # no rotation about (1,1,1)
) )
(options, filenames) = parser.parse_args() (options, filenames) = parser.parse_args()
@ -107,10 +107,8 @@ if np.sum(input) != 1: parser.error('needs exactly one input format.')
(options.quaternion,representations['quaternion'][1],'quaternion'), (options.quaternion,representations['quaternion'][1],'quaternion'),
][np.where(input)[0][0]] # select input label that was requested ][np.where(input)[0][0]] # select input label that was requested
crystalrotation = np.array(options.crystalrotation[1:4] + (options.crystalrotation[0],)) # Compatibility hack r = damask.Rotation.fromAxisAngle(np.array(options.crystalrotation),options.degrees,normalise=True)
labrotation = np.array(options.labrotation[1:4] + (options.labrotation[0],)) # Compatibility hack R = damask.Rotation.fromAxisAngle(np.array(options.labrotation),options.degrees,normalise=True)
r = damask.Rotation.fromAxisAngle(crystalrotation,options.degrees) # crystal frame rotation
R = damask.Rotation.fromAxisAngle(labrotation,options.degrees) # lab frame rotation
# --- loop over input files ------------------------------------------------------------------------ # --- loop over input files ------------------------------------------------------------------------

View File

@ -25,13 +25,13 @@ parser.add_option('-d', '--data',
parser.add_option('-r', '--rotation', parser.add_option('-r', '--rotation',
dest = 'rotation', dest = 'rotation',
type = 'float', nargs = 4, metavar = ' '.join(['float']*4), type = 'float', nargs = 4, metavar = ' '.join(['float']*4),
help = 'angle and axis to rotate data [%default]') help = 'axis and angle to rotate data [%default]')
parser.add_option('--degrees', parser.add_option('--degrees',
dest = 'degrees', dest = 'degrees',
action = 'store_true', action = 'store_true',
help = 'angles are given in degrees') help = 'angles are given in degrees')
parser.set_defaults(rotation = (0.,1.,1.,1.), # no rotation about 1,1,1 parser.set_defaults(rotation = (1.,1.,1.,0), # no rotation about (1,1,1)
degrees = False, degrees = False,
) )
@ -40,8 +40,7 @@ parser.set_defaults(rotation = (0.,1.,1.,1.),
if options.data is None: if options.data is None:
parser.error('no data column specified.') parser.error('no data column specified.')
rotation = np.array(options.rotation[1:4]+(options.rotation[0],)) # Compatibility hack r = damask.Rotation.fromAxisAngle(np.array(options.rotation),options.degrees,normalise=True)
r = damask.Rotation.fromAxisAngle(rotation,options.degrees,normalise=True)
# --- loop over input files ------------------------------------------------------------------------- # --- loop over input files -------------------------------------------------------------------------