-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plate_motion
refactoring: remove pkg dependency
#868
Conversation
Thank you @yuankailiu for this PR, it's very exciting! Removing the extra dependencies is critical for us to integrate it into the routine workflow. After looking at it, it makes a lot of sense to create an object/class for the Euler pole initiation/calculation, maybe in an independent script, e.g. It's also a good time to include a basic unit test (#402) to compare the calculated PMM at a few selected lat/lon using mintpy with the one using the unavco web calculator (https://www.unavco.org/software/geodetic-utilities/plate-motion-calculator/plate-motion-calculator.html). After the above is finished I assume. |
plate_motion
refactoring: remove pkg dependency
843fd16
to
7862b08
Compare
+ Use matrix rotation of the cartesian frame to compute the plate motion + Add reference to Pichon et al., 1973, Cox et al., 1986, ESA webpage + thus we can remove the dependency on: 1) astropy 2) platemotion: https://github.com/lcx366/PlateTectonic
+ merge correct_plate_motion() into run_plate_motion() as the former is too simple + use mintpy docs/comments style for most of the functions + rename and merge T_*() into rotation_matrix_cart2enu() to be more explicit and reduce redundancy + remove the unused azimuth() + turn ON ellps by default
+ create an object of the EulerPole class for Euler pole initiation/calculation (a similar form as https://github.com/joferkington/euler_pole/blob/master/euler_pole/euler_pole.py.) + plate_motion.py calla the class and functions from objects/euler.py
+ include a basic euler.py unit test to compare the calculated PMM at a few selected lat/lon + comparing using mintpy with the one using the unavco web calculator (https://www.unavco.org/software/geodetic-utilities/plate-motion-calculator/plate-motion-calculator.html).
+ rename class functions and variables as MintPy style + user readable variable names in class functions + rename the object module name to `euler_pole.py` + add assertion in tests/objects/euler_pole.py + remove pandas dependency + codacy tests
Hi @yunjunz, I am done with the changes. Please take a look! |
Great, I will check it now. Thank you @yuankailiu for the refactoring. |
+ use snake_case for function names + get_velocity_xyz(): support 1/2D np array inputs + move get_azimuth_angle_from_east_north_obs() to utils.utils0.py + add tests/objects/euler_pole.py to the circle CI test + adjust other scripts accordingly
+ change rotationRate to rot_rate
Hi @yuankailiu, one last question on this PR: the calculated plate motion in the vertical direction is forced to zero in the previous version ( Line 133 in c15ad0f
|
I think we can keep the verticles. People will need to understand when using the non-spherical Earth, we will inevitably have some tiny verticles. |
Thank you Kai. Good point. Related to the vertical component, when
|
I see. Thanks a lot for testing this! Yes, I think in that case (when ellips=False), we can just set it to zero. Good point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @yuankailiu for this PR! I really like its structure: the class definition and unit tests could serve as a template/example for future new features.
Description of proposed changes
Use matrix rotation of the cartesian frame to compute the plate motion from the Euler pole
Add reference to Pichon et al., 1973, Cox et al., 1986, ESA webpage
thus we can remove the dependency on (1) astropy, and (2) platemotion: https://github.com/lcx366/PlateTectonic
Reminders