Thanks very much for make geographiclib available, it is a wanderful library.
I think it will be nice to have a function in MagneticModel that could calculate the geomagnetic components in ECEF coordinates given the position XYZ in ECEF.
I just make a first attempt adding a member function
void FieldECEF(real t, real X, real Y, real Z, real& Bx, real& By, real& Bz) const;
editing files (see FieldECEF.zip)
include/GeographicLib/MagneticModel.hpp
src/MagneticModel.cpp
I’m working in a program to trace geomagnetic lines, and I think it is much more easy working direct in ECEF.
OK, perhaps this makes sense, since the current Field method computes the geocentric result and then expresses this in geodetic coordinates. If I do incorporate it, I will pick a different nomenclature (GeographicLib uses Geocentric instead of ECEF). Also I would make Field call the geocentric version to minimize the duplication of code. I'll look into this sometime in Jan, 2020.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2019-12-19
Thank you for considering to incorporate it. Taking in account your comments, I tried a new implementation that at least didn't break any test. Hopefully it could help you a little next January, in case you decide to implement it.
Just in case you are still considering to incorpoate the FieldGeocentric method, I did a implemantation in the branch devel after commit 99c2d9fb36818f1a203477aab93f88d408bbf224, which results in the attached git diff FieldGeocentric.diff
at least all tests passed here.
I've added your patch to my devel branch. I made a few cosmetic changes and also added a similar capability to the MagneticCircle class. I'd appreciate it if you could test the changes. Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks very much for make geographiclib available, it is a wanderful library.
I think it will be nice to have a function in MagneticModel that could calculate the geomagnetic components in ECEF coordinates given the position XYZ in ECEF.
I just make a first attempt adding a member function
void FieldECEF(real t, real X, real Y, real Z, real& Bx, real& By, real& Bz) const;
editing files (see FieldECEF.zip)
include/GeographicLib/MagneticModel.hpp
src/MagneticModel.cpp
I’m working in a program to trace geomagnetic lines, and I think it is much more easy working direct in ECEF.
OK, perhaps this makes sense, since the current Field method computes the geocentric result and then expresses this in geodetic coordinates. If I do incorporate it, I will pick a different nomenclature (GeographicLib uses Geocentric instead of ECEF). Also I would make Field call the geocentric version to minimize the duplication of code. I'll look into this sometime in Jan, 2020.
Thank you for considering to incorporate it. Taking in account your comments, I tried a new implementation that at least didn't break any test. Hopefully it could help you a little next January, in case you decide to implement it.
Just in case you are still considering to incorpoate the FieldGeocentric method, I did a implemantation in the branch devel after commit 99c2d9fb36818f1a203477aab93f88d408bbf224, which results in the attached git diff FieldGeocentric.diff
at least all tests passed here.
I'm sorry I didn't get around to reviewing this yet. I've put this on my TODO list, however.
ok, I'm glad to hear that it's on your TODO list.
just in case someone find it useful, updating the FieldGeocentric.diff in relation to branch devel commit 594a80321a7eaa1a06a0fc99639c1b5b3517b3d8
Many thanks. I should be including this in my devel branch within the next 2 weeks.
I've added your patch to my
devel
branch. I made a few cosmetic changes and also added a similar capability to theMagneticCircle
class. I'd appreciate it if you could test the changes. Thanks.I tested the changes and they work very well. Thank you very much.