Menu

geomagnetic components in ECEF coordinates

Anonymous
2019-12-18
2021-02-24
  • Anonymous

    Anonymous - 2019-12-18

    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.

     
  • Charles Karney

    Charles Karney - 2019-12-19

    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.

     
  • 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.

     
  • Marcelo Banik de Padua

    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.

     
  • Charles Karney

    Charles Karney - 2020-11-22

    I'm sorry I didn't get around to reviewing this yet. I've put this on my TODO list, however.

     
  • Marcelo Banik de Padua

    ok, I'm glad to hear that it's on your TODO list.

     
  • Marcelo Banik de Padua

    just in case someone find it useful, updating the FieldGeocentric.diff in relation to branch devel commit 594a80321a7eaa1a06a0fc99639c1b5b3517b3d8

     
  • Charles Karney

    Charles Karney - 2021-02-15

    Many thanks. I should be including this in my devel branch within the next 2 weeks.

     
  • Charles Karney

    Charles Karney - 2021-02-22

    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.

     
  • Marcelo Banik de Padua

    I tested the changes and they work very well. Thank you very much.

     

Anonymous
Anonymous

Add attachments
Cancel