In [21]:
import rotcoord
import pygslib
In [22]:
parameters = {
'datafl' : '_xxx_.out', # path to file, or none (to use '_xxx_.in') or numpy array (with columns [x,y])
'icolx' : 1, # -columns with X and Y coordinates
'icoly' : 2,
'outfl' : 'test.out', # path to the output file or None (to use '_xxx_.out')
'xorigin': 0, # origin of rotated system in original coordinates (pibot point)
'yorigin': 0,
'angle' : 45, # rotation angle (in degrees clockwise)
'switch' : 0} # -0=convert to rotated coordinate system, -1=convert from rotated system to original system
In [23]:
result =rotcoord.rotcoord(parameters)
In [24]:
result.head()
Out[24]:
In [25]:
result.to_csv('test.csv', index=False)
In [26]:
parameters = {
'datafl' : result[['X','Y']].values, # path to file, or none (to use '_xxx_.in') or numpy array (with columns [x,y])
'icolx' : 1, # -columns with X and Y coordinates
'icoly' : 2,
'outfl' : 'test.out', # path to the output file or None (to use '_xxx_.out')
'xorigin': 0, # origin of rotated system in original coordinates (pibot point)
'yorigin': 0,
'angle' : 45, # rotation angle (in degrees clockwise)
'switch' : 0} # -0=convert to rotated coordinate system, -1=convert from rotated system to original system
In [27]:
result2 =rotcoord.rotcoord(parameters)
result[['Xr', 'Yr']] = result2[['Rotated X','Rotated Y']]
result.to_csv('test.csv', index=False)
In [28]:
result.head()
Out[28]:
In [34]:
ax = result.plot(x= 'X', y='Y', kind = 'scatter', color='b')
result.plot(x= 'Rotated X', y='Rotated Y', kind = 'scatter', color='r', ax = ax)
Out[34]:
In [ ]: