wisehas.blogg.se

Earth magnetic field calculator
Earth magnetic field calculator











earth magnetic field calculator
  1. #Earth magnetic field calculator update
  2. #Earth magnetic field calculator code

These scripts both utilize the Mapping Toolbox to plot globes upon which magnetic field lines are plotted, but if the user does not have that package, a crude globe with just latitude and longitude lines is shown. dat files will hopefully continue to be uploaded to the following website (though it appears the files haven't been updated since 2007):įinally, I have included two example scripts showing how the function IGRFLINE works: plotbline.m and plotbearth.m.

#Earth magnetic field calculator update

Updates happen every five years, with the last update occurring in 2015. dat files with their newer versions in a subfolder called 'datfiles' within the same directory that the function getigrfcoefs.m is located and run getigrfcoefs, and then replace the file it generates (igrfcoefs.mat) with the old. The program is designed to be scalable with time: As new IGRF generations are released, simply replace the old. The only prerequisite to running either the function IGRF or the function IGRFLINE is to put the file igrfcoefs.mat in the MATLAB search path. ecef2geod: Converts ECEF coordinates to geodetic. geod2ecef: Converts geodetic coordinates to ECEF coordinates. plotbearth: Plots a number of magnetic field lines. *grf*.dat: 12th generation IGRF coefficient data files. loadigrfcoefs.m: Loads the proper IGRF coefficients at a given time (making the necessary interpolation). igrfcoefs.mat: IGRF coefficients of the 12th IGRF generation (most recent as of 2015). dat files provided on the IGRF website and saves them to a. getigrfcoefs.m: Extracts coefficients from the. igrfline.m: Gives the coordinates along a magnetic field line starting at a given point. igrf.m: Computes Earth's magnetic field at a point(s).

#Earth magnetic field calculator code

In fact, my motivation in writing the program was to provide an IGRF implementation in MATLAB with minimal "fuss." Another motivation was a vectorized IGRF function, which this function is (with a separate routine adapted directly from the FORTRAN code that is faster for scalars implemented as well). It does not use a compiled FORTRAN mex file, which probably makes it slower but at the advantage of being easier to use (as no compilation is necessary). This program is a conversion of the FORTRAN subroutines that make the calculation into MATLAB.

earth magnetic field calculator

The International Geomagnetic Reference Field (IGRF) is an internationally agreed upon mathematical model of the Earth's magnetic field.













Earth magnetic field calculator