International Reference Ionosphere (IRI) Model
Updated 7 Dec 2019
Computes the International Reference Ionosphere (IRI), which is an internationally recognized model for various ionospheric properties. I would call it more of a hack than a true IRI implementation as it works by querying an online interface using the curl command on an operating system terminal. Because of this, it requires an internet connection and is pretty slow, but if high speed is not an important issue for you, this can be an easy way to get IRI data into MATLAB. There are two functions that call different IRI versions. Function iri2012 calls the 2012 version found at https://ccmc.gsfc.nasa.gov/modelweb/models/iri2012_vitmo.php, and function iri2016 calls the more recent 2016 version whose online interface is at https://ccmc.gsfc.nasa.gov/modelweb/models/iri2016_vitmo.php.
An example script for how to use the functions is given as iritest.m. This is also the script that generated the attached screenshot. Using a parfor loop on my dual core computer, the iri2012 function took about 5 minutes to run. (For comparison, the IGRF (commented out in the script) takes just over 1 second to run.) You can select which of the two provided functions to test with the function handle fun2test on line 13, and when using a parfor loop (set by the boolean useparfor on line 14), the function's progress can be displayed by utilizing the function parfor_progress on the File Exchange (File ID: 32101).
As stated, the query is made using the command curl in an operating system terminal. This program is built-in to Unix (and Mac I believe) but not Windows. Windows users can download cURL from http://curl.haxx.se/download.html. You'll have to download the appropriate executable for your operating system, and I recommend putting it in the same directory as the provided functions.
Drew Compston (2023). International Reference Ionosphere (IRI) Model (https://www.mathworks.com/matlabcentral/fileexchange/34863-international-reference-ionosphere-iri-model), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Removed the iri2007 version because it no longer works.
Fixed issue with non-leap year day of year sweeps (as pointed out by Cory in comments above).
Fixed error in input argument order in the list in the initial comment block for the iri2012 function.
Made iri2012 compatible with new online interface having auroral boundary option.
Added more information on inputs in initial comment block, provided functions to call both IRI-2007 and IRI-2012, added capability to run functions in a parfor loop, changed output from multiple vectors to single matrix.
Fixed some problems in sweeping day of year/month/etc.
Fixed problem where online interface would hang without returning anything for some inputs (including in iritest.m).
Fixed bug pointed out by Brandon (old line 459 actually I believe, not 496) and also fixed an odd issue with the online interface output for longitude sweeps and non-default altitude (first noticed by John H.).
Updated initial comment block, added an error check on calling curl, fixed/updated some of the other error checks, and added capability to run example script without Mapping Toolbox.
Fixed geocentric coordinate conversion bug.
Fixed a problem where the online interface didn't do a full sweep for fractional steps and added an error check on reading temp.html from the interface.
Fixed some more typos in the comments of the files and made the changes suggested in Allen Kummer's comments.
Fixed typo in title/description.