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
Overlap and collaboration with Harmonica #24
Comments
Just wanted to make an initial reply: |
Hi @leouieda I took a quick look. From the functions you linked above, I don't initially see a conflict with the style of API I use in PyMap3D. That is, where each input/output coordinate is a separate variable, that can be scalar or N-dimensional. The point that needs harmonization is the ability to call the PyMap3D functions as methods of the Harmonica base class. In any case, I think this object-oriented approach, where the ellipsoid is the object is nice. However, I have other users who may want to make the sensing platform the object. What is the key thing stopping you from using PyMap3D in Harrmonica? Is it how the ellipsoid is handled? Almost all PyMap3D functions don't directly use the ellipsoid, they just pass None or the requested string value along to the core numerical functions that actually use it. So maybe if I implemented your |
Hi @scivision sorry I let the thread die here. 2019 was an eventful year for me. Some recent progress on this front: I've been chatting with the developers of SHTOOLS and pygeoid, which has some overlapping functionality with regards to the ellipsoids. In particular the calculation of normal gravity, not so much the coordinate conversions. See ioshchepkov/pygeoid#7 To try to pool our efforts, I create a prototype package that would house the ellipsoid definition and normal gravity calculations: Boule. The idea is that the 3 projects could share this common functionality and then implement the more specific parts in separately (shtools does spherical harmonics, pygeoid does geoid calculations, and harmonica is more applied geophysics). In the end, I ditched the Looking back at pymap3D, I think the We're starting to need some simple coordinate conversions (fatiando/boule#29) and could leverage pymap3d for those:
I'm more prone to 1 because I can never remember what things like I understand that you want to keep the dependencies minimal (non-existent) so depending on Boule would not be an option. At the same time, I'm more interested in integrating with things like xarray and unit packages (like pint and unyt). But I'd like to leverage what you have here and hopefully contribute back to pymap3d 🙂 |
It's worth a Wiki entry, but what I'm aiming for is to have pymap3d functions with only Python stdlib i.e. Transparently, if Numpy is available then Numpy is used for N-dimensional arrays. Finally, if the input arrays are xarray, we try to pass that through too. Yes the names are made to match Matlab Mapping toolbox, to help those looking to transition from Matlab to Python. I don't think there's any overhead to map multiple names to a single function if it's more intuitive to have a name for your specialty. |
Closing this since with fatiando/boule#121 we should be able to pass |
Hi @scivision, I've been developing a package for gravity and magnetic geophysics called Harmonica with @santisoler. We've been having the need for some coordinate conversions not found in proj4 and ended up implementing our own functions and an ellipsoid class. I recently thought of pymap3d and was poking around the code base again and there are some similarities with what we've been doing. I think there is opportunity for collaboration here and maybe porting some of our code into pymap3d. I always felt like these things were a bit out of place in Harmonica. Here are a few links:
ReferenceEllipsoid
class and handling functions: https://github.com/fatiando/harmonica/blob/master/harmonica/ellipsoid.pyReferenceEllipsoid
to compute Normal gravity: https://github.com/fatiando/harmonica/blob/master/harmonica/gravity_corrections.py#L10I really like our way of handling ellipsoids across the library. We have a global default ellipsoid and ways of setting different (or custom) ellipsoids using context managers. For example, you can change ellipsoids like this:
Functions that need an ellipsoid can get the currently set one by calling
get_ellipsoid()
and everything works. See these examples.I really like this mechanic and I feel like it could work well with pymap3d. I don't what's the best way of moving forward but I wanted to make sure we're all aware of the two projects 🙂 Notice that we need more than a, b, f for our ellipsoids because of the gravity calculations (which could be made optional).
How committed are you to supporting the Matlab toolkit interface? If your primary goal is compatibility then it might not work well but I think there is a lot of room for improvement on the API front (many of these Matlab toolkits are a bit poorly design, IMO).
What do you think?
The text was updated successfully, but these errors were encountered: