About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

scripts default iconInternational Geomagnetic Reference Field (IGRF) Model (Scripts) Publisher's description

The International Geomagnetic Reference Field (IGRF)

The International Geomagnetic Reference Field (IGRF) is an internationally agreed upon mathematical model of the Earth's magnetic field. This program is a conversion of the FORTRAN subroutines that make the calculation into MATLAB. 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). 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).

The following files are provided:

-igrf.m: Computes Earth's magnetic field at a point(s).
-igrfline.m: Gives the coordinates along a magnetic field line starting at a given point.
-getigrfcoefs.m: Extracts coefficients from the .dat files provided on the IGRF website and saves them to a .mat file.
-igrfcoefs.mat: IGRF coefficients of the 11th IGRF generation (most recent as of 2010).
-loadigrfcoefs.m: Loads the proper IGRF coefficients at a given time (making the necessary interpolation).
-*grf*.dat: 11th generation IGRF coefficient data files.
-plotbline: Plots a magnetic field line.
-plotbearth: Plots a number of magnetic field lines.

The only prerequisite to running either the function IGRF is to put the file igrfcoefs.mat in the MATLAB search path. The program is designed to be scalable with time: As new IGRF generations are released, simply replace the old .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 .mat file. Updates happen every five years, with the last update occurring in 2010. New .dat files will hopefully continue to be uploaded to the following ftp:

In writing this function, I discovered that MATLAB provides an IGRF function in the Aerospace Toolbox, so the function IGRF will not add anything new to users with that package. However, the Aerospace Toolbox does not provide a function with the same capability as IGRFLINE as far as I know.

Having said that, IGRFLINE utilizes the function ECEF2LLA in the Aerospace Toolbox. Not all is lost for users without that package, though, as a free implementation of the Aerospace Toolbox's ECEF2LLA function can be found on the MATLAB file exchange at:

Finally, I have included two example scripts showing how the function IGRFLINE works: plotbline.m and plotbearth.m. 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.

I've made some cursory comparisons with the online IGRF calculator at http://ccmc.gsfc.nasa.gov/modelweb/models/igrf_vitmo.php and found this function to be accurate to within 1 nT. I'm not sure why there is a discrepancy between the two, but my guess is round-off error.

System Requirements:

MATLAB 7.5 (R2007b)
Program Release Status: New Release
Program Install Support: Install and Uninstall

International Geomagnetic Reference Field (IGRF) Model (Scripts) Tags:

Click on a tag to find related softwares

Is International Geomagnetic Reference Field (IGRF) Model (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.