Wolfram Language™

Arrays of Quantities

QuantityArray allows efficient storage and manipulation of arrays of Quantity objects, and it is hence ideal for the analysis of data having physical units. Continuing with the integration of quantities throughout the system, several functions now understand or return QuantityArray objects.

Sample QuantityDistribution objects.

In[1]:=
`RandomVariate[ParetoDistribution[Quantity[500., "USDollars"], 4], 300]`
Out[1]=

A QuantityArray object is equivalent to a normal array of Quantity elements.

In[2]:=
```RandomVariate[ParetoDistribution[Quantity[500., "USDollars"], 4], 300]; Normal[Take[%, 10]]```
Out[2]=

Compute or download arrays of geo data, like elevation or magnetic field data.

In[3]:=
`GeoElevationData[Entity["Country", "UnitedStates"]]`
Out[3]=
In[4]:=
```GeomagneticModelData[ Entity["GeographicRegion", "Antarctica"], "Magnitude"]```
Out[4]=

Manipulate arrays of latitude and longitude angles.

In[5]:=
```GeoElevationData[ Entity["Country", "UnitedStates"], "Undulation", GeoPosition]```
Out[5]=
In[6]:=
```GeoElevationData[ Entity["Country", "UnitedStates"], "Undulation", GeoPosition]; LatitudeLongitude[%]```
Out[6]=

Get an array of data for the vertical component of the gravitational field over China.

In[7]:=
```data = GeogravityModelData[Entity["Country", "China"], "DownComponent"]```
Out[7]=

Examine how the gravitational field differs from the standard value of 9.81 over that region.

In[8]:=
```contourplot = ListContourPlot[data - Quantity[1, "StandardAccelerationOfGravity"], Frame -> False, PlotRangePadding -> 0, ColorFunction -> "SolarColors"]```
Out[8]=

Overlay the contour plot over a map of China.

show complete Wolfram Language input
In[9]:=
```Legended[GeoGraphics[{GeoStyling[{"GeoImage", contourplot}, Opacity[0.8]], Polygon[Entity["Country", "China"]]}, ImageSize -> 500, GeoRange -> Quantity[2200, "Kilometers"], GeoZoomLevel -> 5], BarLegend[{"SolarColors", MinMax@Flatten[QuantityMagnitude@data]}]]```
Out[9]=