Ranges of Values of the Earth's Magnetic Field
The new functions CoordinateBounds and CoordinateBoundingBox allow you to find the extrema values in each dimension of a multidimensional array. This example finds the ranges of values of the Earth's magnetic field in a given region.
Define a region near the North Pole from its latitudes and longitudes.
In[1]:=
![Click for copyable input](assets.en/ranges-of-values-of-the-earths-magnetic-field/In_7.png)
lat = {65, 85};
lon = {-30, 30};
Plot this region on a world map.
In[2]:=
![Click for copyable input](assets.en/ranges-of-values-of-the-earths-magnetic-field/In_8.png)
GeoGraphics[GeoBoundsRegion[{lat, lon}], GeoGridLines -> Automatic,
GeoZoomLevel -> 5]
Out[2]=
![](assets.en/ranges-of-values-of-the-earths-magnetic-field/O_7.png)
Generate the data of the Earth's magnetic field in this region.
In[3]:=
![Click for copyable input](assets.en/ranges-of-values-of-the-earths-magnetic-field/In_9.png)
data = GeomagneticModelData[Transpose[{lat, lon}], GeoZoomLevel -> 1]
Out[3]=
![](assets.en/ranges-of-values-of-the-earths-magnetic-field/O_8.png)
Extract from this data the components of the Earth's magnetic field.
In[4]:=
![Click for copyable input](assets.en/ranges-of-values-of-the-earths-magnetic-field/In_10.png)
components = {"NorthComponent", "EastComponent", "DownComponent"};
arr = Lookup[data, components]
Out[4]=
![](assets.en/ranges-of-values-of-the-earths-magnetic-field/O_9.png)
Convert the list of arrays into an array of 3-vectors.
In[5]:=
![Click for copyable input](assets.en/ranges-of-values-of-the-earths-magnetic-field/In_11.png)
qa = Transpose[QuantityArray[arr], {3, 1, 2}]
Out[5]=
![](assets.en/ranges-of-values-of-the-earths-magnetic-field/O_10.png)
These are the ranges of the components of the Earth's magnetic field in the specified region.
In[6]:=
![Click for copyable input](assets.en/ranges-of-values-of-the-earths-magnetic-field/In_12.png)
Thread[components -> CoordinateBounds[qa]]
Out[6]=
![](assets.en/ranges-of-values-of-the-earths-magnetic-field/O_11.png)