Wolfram Language

Units & Dates

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]:=
Click for copyable input
RandomVariate[ParetoDistribution[Quantity[500., "USDollars"], 4], 300]
Out[1]=

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

In[2]:=
Click for copyable input
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]:=
Click for copyable input
GeoElevationData[Entity["Country", "UnitedStates"]]
Out[3]=
In[4]:=
Click for copyable input
GeomagneticModelData[ Entity["GeographicRegion", "Antarctica"], "Magnitude"]
Out[4]=

Manipulate arrays of latitude and longitude angles.

In[5]:=
Click for copyable input
GeoElevationData[ Entity["Country", "UnitedStates"], "Undulation", GeoPosition]
Out[5]=
In[6]:=
Click for copyable input
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]:=
Click for copyable input
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]:=
Click for copyable input
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]:=
Click for copyable input
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]=

Related Examples

de es fr ja ko pt-br ru zh