Comments (5)
I think that this is correct. The documentation says
Note that this routine uses the “y convention”, where the second rotation is with respect to the new y axis. If alpha, beta, and gamma were originally defined in terms of the “x convention”, where the second rotation was with respect to the new x axis, the Euler angles according to the y convention would be alpha_y=alpha_x-pi/2, beta_x=beta_y, and gamma_y=gamma_x+pi/2.
Now, according to http://mathworld.wolfram.com/EulerAngles.html, the conversion from x to y convention is the same as in the above documentation. Nevertheless, I acknowledge that these definitions are very confusing, so I could be wrong.
from shtools.
You are right, I make mistake when calculate ZYZ and ZXZ matrix.
Sorry for I didn't check the calculation twice.
So does rotate function in SHCoeffs class use euler angle ZYZ as parameters?
Is code in src/SHRotateCoef.f95 line 110 not performing x-convention to y-convention, but something else?
alpha = alpha - pi2
gamma = gamma + pi2
beta = -beta
if that is true,
then the code comment in https://shtools.oca.eu/shtools/pages/mydoc/notebooks/tutorial_3.html is wrong.
...
alpha = 0. # around z-axis
beta = 90. # around x-axis (lon=0)
gamma = 10. # around z-axis again
coeffs_l5m0_rot = coeffs_l5m0.rotate(alpha, beta, gamma, degrees=True)
...
from shtools.
Could you try doing a calculating to see if you get the result you expect? I did not write the rotation routine, and it is quite possible that the snippet of code you extracted from within the routine is correct.
from shtools.
I figured it out. All of the documentation for the functions is correct: SHTOOLS uses the y-convention, and the default is to rotate the coordinate system, not the physical body. However, the description in the tutorial is indeed wrong. I have updated this with the following:
The rotations are specified by the three Euler angles alpha, beta, and gamma. There are several different conventions for specifying these angles, and they can either provide the angles for rotating the physical body or coordinate system. Please read the documentation of this method carefully before proceeding! SHTOOLS uses the "y-convention" where the three angles correspond to (in this order):
Rotation about the z axis by alpha,
Rotation about the new y axis by beta,
Rotation about the new z axis by gamma.By using the angles alpha, beta, and gamma as is, the coordinate system will be rotated without rotation of the physical body. To instead rotate the physical body, and not the coordinate system, you would specify the angles -gamma, -beta, and -alpha.
Then, the example is
alpha = 30. # rotation around the initial z-axis
beta = 90. # rotation aroung the new y-axis
gamma = 0. # rotation around the new z-axis
coeffs_l5m0_rot = coeffs_l5m0.rotate(-gamma, -beta, -alpha, degrees=True)
I hope this clears things up. I really hate rotation angles...
from shtools.
Thanks man, i hate rotation angles too
from shtools.
Related Issues (20)
- Core dumped error for calling pyshtools (4.10) HOT 5
- pygmt is not compatible with SHTOOLS HOT 8
- gravity correction excludes the effect of the polar flattening HOT 3
- Load the coefficients from Complex spherical harmonics HOT 8
- installation issue on Mac with M1 chip HOT 1
- Different spectra from SHExpandGLQ() -> spectrum() in version 4.9.1 and 4.10 HOT 8
- brew install on linux fails with libtool error HOT 8
- Issue with using taper weights when calculating a multitaper localized spectrum HOT 3
- Thread safety HOT 20
- Release SHTOOLS 4.10.2
- Release SHTOOLS v4.10.3
- Extract normalized 2D spectrum values from SHCoeffs HOT 6
- Earth2012 and Earth2014 not callable HOT 2
- NameError: name 'shcoeffs' is not defined HOT 1
- Release SHTOOLS 4.10.4
- Cannot install M1-Mac by pip HOT 4
- Call to dggglm SHExpandLSQ HOT 1
- Installation on Python 3.10.12 error: metadata-generation-failed, No module named 'numpy.distutils' HOT 2
- Install issue can't build wheel. (Using Pycharm) HOT 1
- Exporting grid data to 3D model
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shtools.