`plate_motion` refactoring: remove pkg dependency
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
- [ ] Pass Codacy code review (green)
- [ ] Pass Circle CI test (green)
- [x] Make sure that your code follows our style. Use the other functions/files as a basis.
- [x] If modifying functionality, describe changes to function behavior and arguments in a comment below the function declaration.
- [x] If adding new functionality, add a detailed description to the documentation and/or an example.
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. objects/euler_pole.py, in a similar form as https://github.com/joferkington/euler_pole/blob/master/euler_pole/euler_pole.py. We could try it in the coming week.
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.
Hi @yunjunz, I am done with the changes. Please take a look!
Hi @yunjunz, I am done with the changes. Please take a look!
Great, I will check it now. Thank you @yuankailiu for the refactoring.
Hi @yuankailiu, one last question on this PR: the calculated plate motion in the vertical direction is forced to zero in the previous version (https://github.com/insarlab/MintPy/blob/c15ad0f75ab042130f108512179d255e098a6bdd/mintpy/plate_motion.py#L133), but this is not the case for this PR. Shall we still enforce it?
Hi @yuankailiu, one last question on this PR: the calculated plate motion in the vertical direction is forced to zero in the previous version (
https://github.com/insarlab/MintPy/blob/c15ad0f75ab042130f108512179d255e098a6bdd/mintpy/plate_motion.py#L133
), but this is not the case for this PR. Shall we still enforce it?
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.
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 ellips=False, the resulting vertical component is extremely tiny, which is expected, but the spatial pattern is strange (due to the numerical precision of the computer I guess), as shown below. Shall we set that to zero in euler_pole.py in that scenario, to avoid potentially unnecessary questions from users?
-
San Francisco Sen DSC - Assume Ellipsoid

-
San Francisco Sen DSC - Assume Sphere

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.