({{, (RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData])[] 
returns the current magnetic field data for the current location.}, {, (RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData])[locationspec]
returns the current magnetic field data for a location.}, {, (RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData])[datespec]
returns the magnetic field data for the specified time for the current location.}, {, (RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData])[locationspec,datespec]
returns the magnetic field data for the specified time and location.}, {, (RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData])[locationspec,datespec,component]
returns the component of the magnetic field for the specified time and location.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData])[] makes use of (RefLink[$GeoLocation, paclet:ref/$GeoLocation]) to determine your location and (RefLink[Now, paclet:ref/Now]) to determine current time.

The location loc can be specified as latitude and longitude coordinates {lat,long}, coordinates with a height {lat,long,h}, (RefLink[GeoPosition, paclet:ref/GeoPosition])[…], or as a named (RefLink[Entity, paclet:ref/Entity])[…]. h can be input as a numeric object in meters or as a (RefLink[Quantity, paclet:ref/Quantity]).

locationspec can also be a region as specified by a named (RefLink[Entity, paclet:ref/Entity])[…], or a listed pair of specific locations {(Subscript[locationspec, 1]),(Subscript[locationspec, 2])} or {(Subscript[locationspec, 1]),(Subscript[locationspec, 2]),h}.

For regions, results are returned as arrays or an (RefLink[Association, paclet:ref/Association]) of arrays of magnetic field components by default. Arrays are calculated at the height of a specific coordinate point of the grid above the reference datum unless otherwise specified. If that data is not available, it uses a default height of 0 meters.

The magnetic field is calculated for the current time using the World Magnetic Model or "WMM". The model is updated regularly to account for slow changes in the Earth's magnetic field. Historical magnetic fields use "WMM" if the date is within their range of validity. Otherwise, (RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData]) uses the International Geomagnetic Reference Field ("IGRF") or, for pre-1900 dates, the "GUFM1" model.

datespec can be specified by (RefLink[DateObject, paclet:ref/DateObject]) or (RefLink[DateList, paclet:ref/DateList]).

Location and date can also be specified together as (RefLink[Association, paclet:ref/Association])["Location"->locationspec,"Date"->datespec].

Components include "NorthComponent", "EastComponent", "DownComponent", "HorizontalComponent", "Declination", "Inclination", and "Magnitude". Components are measured relative to the reference ellipsoid "WGS84Original".

"DownComponent" is measured relative to the perpendicular to the reference ellipsoid where positive values are downward. "HorizontalComponent" is the field parallel to the surface at that point. "Declination" is the angle from the direction of true geographic north to the horizontal component, measured clockwise. "Inclination" is the angle between the horizontal component and the vertical component. "Magnitude" is the total magnitude of the field. "Potential" is the magnetic potential.

Components and "Magnitude" are returned in nanoteslas. "Inclination" and "Declination" are returned in angular degrees. "Potential" is returned as nanovolt seconds per meter.

All magnetic field components are returned as an (RefLink[Association, paclet:ref/Association]) unless a specific component is requested.

(RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData])[component] returns the component for the current magnetic field at your location.

(RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData])[locationspec,component] returns the component for the current magnetic field at the specified location.

(RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData])[locationspec,component,func] and (RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData])[locationspec,datespec,component,func] are used to specify the format of output when extended locations are specified.

Possible settings for func include:

(RefLink[GeoVector, paclet:ref/GeoVector]) and (RefLink[GeoVectorENU, paclet:ref/GeoVectorENU]) are not available for "Potential" or "Magnitude" components.

(RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData]) also includes the following properties: "NorthGeomagneticPole", "NorthModelDipPole", "NorthModelDipPoleGeoElevation", "SouthGeomagneticPole", "SouthModelDipPole", and "SouthModelDipPoleGeoElevation". These can be used to find the respective poles for the current or historical times.

(RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData]) takes the following options:

(RefLink[Method, paclet:ref/Method]) has the suboption "Model", which allows you to specify what model to use. Available models include "WMM", "IGRF", and "GUFM1".

The spatial resolution of the requested gravitational field data can be selected with the option (RefLink[GeoZoomLevel, paclet:ref/GeoZoomLevel])->zoom, where zoom is an integer.

OpenersPrimaryExamplesSection(Spacer1)Examples  (30)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Find the magnetic field components at a geographic position:

GeomagneticModelData[GeoPosition[{45, -120, 100}]]

Use (RefLink[Entity, paclet:ref/Entity]) to specify a location:

GeomagneticModelData[(Entity["New York City", Entity["City",{"NewYork","NewYork","UnitedStates"}], "Entity[\"City\", {\"NewYork\", \"NewYork\", \"UnitedStates\"}]", "city"])]

Find the magnetic field at a location and time:

GeomagneticModelData[(Entity["New York City", Entity["City",{"NewYork","NewYork","UnitedStates"}], "Entity[\"City\", {\"NewYork\", \"NewYork\", \"UnitedStates\"}]", "city"]),DateObject[{2012,12,22}]]

OpenersExampleSection1(Spacer1)Scope  (16)

OpenersExampleSubsection0(Spacer1)Location Specification  (6)

Find the magnetic field components for the current location:

GeomagneticModelData[]

Provide location as a (RefLink[GeoPosition, paclet:ref/GeoPosition]):

GeomagneticModelData[GeoPosition[{45, -90}]]

Location can be given as a list of coordinates and local height:

GeomagneticModelData[{45, -120, 100}]

Coordinates and height can be specified with (RefLink[Quantity, paclet:ref/Quantity]):

GeomagneticModelData[{Quantity[35,"AngularDegrees"], Quantity[-90,"AngularDegrees"], Quantity[50,"Yards"]}]

Find an array of magnetic vectors over a rectangular region defined by two points:

GeomagneticModelData[{{40, -5},{45, 5}},GeoZoomLevel->2]

Points can be specified with (RefLink[GeoPosition, paclet:ref/GeoPosition]) or (RefLink[Entity, paclet:ref/Entity]):

GeomagneticModelData[{(Entity["New York City", Entity["City",{"NewYork","NewYork","UnitedStates"}], "Entity[\"City\", {\"NewYork\", \"NewYork\", \"UnitedStates\"}]", "city"]),GeoPosition[{40, -80}]},GeoZoomLevel->2]["Potential"]

Set the height at which the magnetic vectors will be calculated over the region:

GeomagneticModelData[{{40, -5},{45, 5},Quantity[200,"Meters"]},GeoZoomLevel->1]["DownComponent"]

Calculate the magnetic field over the region defined by an (RefLink[Entity, paclet:ref/Entity]):

GeomagneticModelData[(Entity["France", Entity["Country","France"], "Entity[\"Country\", \"France\"]", "country"]),GeoZoomLevel->1]["Declination"]

Include a reference height:

GeomagneticModelData[{(Entity["France", Entity["Country","France"], "Entity[\"Country\", \"France\"]", "country"]),Quantity[1000,"Yards"]},GeoZoomLevel->1]["Declination"]

OpenersExampleSubsection1(Spacer1)Date Specification  (2)

Find the magnetic field components for historical times:

GeomagneticModelData[DateObject[{2010,1,1}]]

Find the magnetic field component at a specific place and time:

GeomagneticModelData[GeoPosition[{45, -90}],DateObject[{2000,1,1}]]

OpenersExampleSubsection2(Spacer1)Component Specification  (3)

Request specific components of the magnetic field:

GeomagneticModelData[{Quantity[40,"AngularDegrees"], Quantity[-90,"AngularDegrees"], Quantity[500,"Feet"]},"EastComponent"]

GeomagneticModelData[{Quantity[40,"AngularDegrees"], Quantity[-90,"AngularDegrees"], Quantity[500,"Feet"]},"DownComponent"]

Find the derived components of a magnetic field:

GeomagneticModelData[{Quantity[40,"AngularDegrees"], Quantity[-90,"AngularDegrees"], Quantity[500,"Feet"]},"Declination"]

Calculate the magnitude of the magnetic field:

GeomagneticModelData[{Quantity[40,"AngularDegrees"], Quantity[-90,"AngularDegrees"], Quantity[500,"Feet"]},"Magnitude"]

OpenersExampleSubsection3(Spacer1)Format Specification  (2)

Find the range of the east component for an extended region:

GeomagneticModelData[(Entity["New York, United States", Entity["AdministrativeDivision",{"NewYork","UnitedStates"}], "Entity[\"AdministrativeDivision\", {\"NewYork\", \"UnitedStates\"}]", "administrative division"]),"EastComponent",Interval,GeoZoomLevel->1]

Obtain the maximum or mean value of a component for a region:

GeomagneticModelData[{{40, -5,0},{45, 5,0}},"Magnitude",Max,GeoZoomLevel->1]

GeomagneticModelData[{{40, -5,0},{45, 5,0}},"DownComponent",Mean,GeoZoomLevel->1]

OpenersExampleSubsection4(Spacer1)Association Specification  (2)

Date and location can be specified together using (RefLink[Association, paclet:ref/Association]):

GeomagneticModelData[Association["Location"->GeoPosition[{45, -90}],"Date"->DateObject[{2000,1,1}]]]

(RefLink[Association, paclet:ref/Association]) specification works with component arguments:

GeomagneticModelData[Association["Location"->GeoPosition[{45, -90}],"Date"->DateObject[{2000,1,1}]],"DownComponent"]

OpenersExampleSubsection5(Spacer1)Poles  (1)

Find the properties of (RefLink[GeomagneticModelData, paclet:ref/GeomagneticModelData]):

GeomagneticModelData["Properties"]

Find the north geomagnetic pole:

GeomagneticModelData["NorthGeomagneticPole"]

Calculate the position of the southern dip pole in 1943:

GeomagneticModelData["SouthModelDipPole",DateObject[{1943,1,1}]]

OpenersExampleSection2(Spacer1)Options  (2)

OpenersExampleSubsection6(Spacer1)GeoZoomLevel  (1)

Control the size of the array produced for an extended region using (RefLink[GeoZoomLevel, paclet:ref/GeoZoomLevel]):

GeomagneticModelData[{(Entity["New York City", Entity["City",{"NewYork","NewYork","UnitedStates"}], "Entity[\"City\", {\"NewYork\", \"NewYork\", \"UnitedStates\"}]", "city"]),{45, -90}},"Magnitude",GeoZoomLevel->1]

GeomagneticModelData[{(Entity["New York City", Entity["City",{"NewYork","NewYork","UnitedStates"}], "Entity[\"City\", {\"NewYork\", \"NewYork\", \"UnitedStates\"}]", "city"]),{45, -90}},"Magnitude",GeoZoomLevel->2]

OpenersExampleSubsection7(Spacer1)Method  (1)

Use the (RefLink[Method, paclet:ref/Method]) option to compare the IGRF and WMM models:

GeomagneticModelData[Method->{"Model"->"WMM"}]-GeomagneticModelData[Method->{"Model"->"IGRF"}]

OpenersExampleSection3(Spacer1)Applications  (5)

Find the magnitude of the magnetic field at a location:

GeomagneticModelData[(Entity["Champaign", Entity["City",{"Champaign","Illinois","UnitedStates"}], "Entity[\"City\", {\"Champaign\", \"Illinois\", \"UnitedStates\"}]", "city"]),"Magnitude"]

Calculate the angle to the vertical:

GeomagneticModelData[(Entity["Champaign", Entity["City",{"Champaign","Illinois","UnitedStates"}], "Entity[\"City\", {\"Champaign\", \"Illinois\", \"UnitedStates\"}]", "city"]),"Inclination"]

UnitConvert[%,"Radians"]

Find the Lorentz force on an electron in a hydrogen atom traveling perpendicular to the vertical:

speed=UnitConvert[Sqrt[2Quantity[13.6,"Electronvolts"]/Quantity[1,"ElectronMass"]],"SIBase"]

FormulaData[{"LorentzForce","ParticleSpeed"},{"Q"->(QuantityUnit), "v"->speed,"B"->GeomagneticModelData["DownComponent"]}]

Calculate how declination varies with latitude:

data=Table[{i,GeomagneticModelData[GeoPosition[{i,-140}],"Declination"]},{i,40,90}];

ListPlot[data]

Explore how the geomagnetic field changes with time:

pos=GeoPosition[(Entity["Anchorage", Entity["City",{"Anchorage","Alaska","UnitedStates"}], "Entity[\"City\", {\"Anchorage\", \"Alaska\", \"UnitedStates\"}]", "city"])];

ListPlot[Table[{i,GeomagneticModelData[pos,DateObject[{i,1,1}],"Declination"]},{i,1900,2014}]]

Track the location of a perpendicular magnetic field or dip pole over time:

locs=Table[GeomagneticModelData["NorthModelDipPole",DateObject[{i,0,0}]],{i,1950,2010}];

GeoGraphics[Arrow[locs],GeoRange->Quantity[1500,"Miles"],GeoCenter->GeoPosition[{90,0}]]

OpenersExampleSection4(Spacer1)Possible Issues  (3)

Coordinates must be in the correct dimensions:

GeomagneticModelData[{Quantity[40,"Seconds"], -100}]

The geomagnetic models are only valid near the Earth's surface:

GeomagneticModelData[GeoPosition[{40, -100,Quantity[5000,"Miles"]}]]

Historical models have a limited range of validity:

GeomagneticModelData[GeoPosition[{40, -100}],DateObject[{1400,1,1}]]

For the World Magnetic Model, this is even more limited:

GeomagneticModelData[GeoPosition[{40, -100}],DateObject[{2000,1,1}],Method->{"Model"->"WMM"}]

OpenersExampleSection5(Spacer1)Neat Examples  (2)

Examine the magnitude of the geomagnetic field across the entire planet:

plot=ListContourPlot[QuantityMagnitude@GeomagneticModelData[{{-90,-180.},{90,180.}},"Magnitude",GeoZoomLevel->-2],Frame->False,PlotRangePadding->0,ColorFunction->"TemperatureMap"];

GeoGraphics[{GeoStyling[{"GeoImage",plot}],Opacity[0.4],Polygon[GeoPosition[{{-90,-180},{90,-180},{90,180},{-90,180}}]]},GeoRange->"World"]

Explore the change in declination across the globe:

plot2=ListContourPlot[QuantityMagnitude@GeomagneticModelData[{{-90,-180.},{90,180.}},"Declination",GeoZoomLevel->-2],Frame->False,Contours->36,PlotRangePadding->0,ColorFunction->"TemperatureMap"];

GeoGraphics[{GeoStyling[{"GeoImage",plot2}],Opacity[0.4],Polygon[GeoPosition[{{-90,-180},{90,-180},{90,180},{-90,180}}]]},GeoRange->"World"]

Examine how the Earth's magnetic field changes over time:

data=GeomagneticModelData[{{-90, -180.}, {90, 180.}},DateObject[{2000,1,1}], "Declination", GeoZoomLevel -> -2]-GeomagneticModelData[{{-90, -180.}, {90, 180.}},DateObject[{2010,1,1}], "Declination", GeoZoomLevel -> -2];

plot=ListContourPlot[QuantityMagnitude@data,Frame->False,Contours->36,PlotRangePadding->0,ColorFunction->"TemperatureMap"];

GeoGraphics[{GeoStyling[{"GeoImage",plot}],Opacity[0.4],Polygon[GeoPosition[{{-90,-180},{90,-180},{90,180},{-90,180}}]]},GeoRange->"World"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[GeogravityModelData, paclet:ref/GeogravityModelData])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Geographic Data & Entities, paclet:guide/GeographicData])}, {▪(RefLinkPlain[Earth Sciences: Data & Computation, paclet:guide/EarthSciencesDataAndComputation])}})}})