Richer Knowledgebase Access

Create a Fireball Meteor EntityStore

The Wolfram Knowledgebase contains a vast wealth of information spanning many diverse areas. It also boasts a powerful suite of functionality for representing, accessing, and computing with this knowledge. Now it is also possible (and even straightforward) for users to create their own entity-property collections and work with them as if they were built-in data. Here, the process of creating and using an entity store for fireball meteors (known as bolides) based on an existing data source is illustrated.

Use Import to download a bolide dataset maintained by the Jet Propulsion Laboratory.

In[1]:=
Click for copyable input
(rawdata = Import["http://neo.jpl.nasa.gov/fireballs/", "FullData"])[[3, 9, 2, 12, 1, ;; 5]]
Out[1]=

Define a utility function to attach units to the raw data.

In[2]:=
Click for copyable input
AddUnits[x_, u_: "Kilometers"/"Seconds"] := If[NumberQ[x], Quantity[Interpreter["Number"][x], u], Missing["NotAvailable"]]

Extract relevant parts of the data, add appropriate Quantity tagging, and create the entity store.

show complete Wolfram Language input
In[3]:=
Click for copyable input
bolidedata = DeleteCases[{ DateObject[#1], With[{i = Interpreter["GeoCoordinates"][#2 <> " " <> #3]}, If[Head[i] === Missing, i, GeoPosition[Join[i[[1]], If[NumberQ[#4], {#4 10^3}, {}]]]]], AddUnits[#5], AddUnits[#6], AddUnits[#7], AddUnits[#8], AddUnits[#9, "Joules"], AddUnits[#10, "MetricKilotons"] } & @@@ rawdata[[3, 9, 2, 12, 1, 2 ;;]], {_, _Missing, __}];
In[4]:=
Click for copyable input
entities = Association @@ MapIndexed[ "Bolide" <> ToString[First[#2]] -> <| "Date" -> #[[1]], "Position" -> #[[2]], "Velocity" -> #[[3]], "VelocityX" -> #[[4]], "VelocityY" -> #[[5]], "VelocityZ" -> #[[6]], "TotalRadiatedEnergy" -> #[[7]], "CalculatedTotalImpactEnergy" -> #[[8]], "Label" -> "bolide on " <> DateString[#[[1]]] <> " GMT" |> &, bolidedata];
In[5]:=
Click for copyable input
properties = <| "Date" -> <|"Label" -> "date"|>, "Position" -> <|"Label" -> "position"|>, "Velocity" -> <|"Label" -> "velocity"|>, "VelocityX" -> <|"Label" -> "velocity x\[Hyphen]component"|>, "VelocityY" -> <|"Label" -> "velocity y\[Hyphen]component"|>, "VelocityZ" -> <|"Label" -> "velocity z\[Hyphen]component"|>, "TotalRadiatedEnergy" -> <|"Label" -> "total radiated energy"|>, "CalculatedTotalImpactEnergy" -> <|"Label" -> "calculated total impact energy"|> |>;
In[6]:=
Click for copyable input
store = EntityStore["Bolide" -> <| "Label" -> "bolide", "LabelPlural" -> "bolides", "Entities" -> entities, "Properties" -> properties |>]
Out[6]=

Register the store for this session.

In[7]:=
Click for copyable input
PrependTo[$EntityStores, store];

Create an "EntityAssociation" of bolide positions and energies.

In[8]:=
Click for copyable input
ea = EntityValue["Bolide", {"Position", "TotalRadiatedEnergy"}, "EntityAssociation"];

Make a geographic plot of bolide visibilities based on their heights and sky positions.

In[9]:=
Click for copyable input
GeoGraphics[{GeoVisibleRegion[#] & @@@ Values[ea]}]
Out[9]=

Extract bolide energies into a QuantityArray.

In[10]:=
Click for copyable input
energies = QuantityArray[Values[ea][[All, -1]]]
Out[10]=

Visualize bolide energies using a histogram.

In[11]:=
Click for copyable input
Histogram[energies, "Log", AxesLabel -> {"energy (J)", "count"}]
Out[11]=

Apply a scaling function to give a qualitative picture of fireball brightnesses.

show complete Wolfram Language input
In[12]:=
Click for copyable input
scale[e_] := Quantity[1.*10^4 Sqrt[e/Max[energies]], "Kilometers"]
In[13]:=
Click for copyable input
GeoGraphics[{Red, GeoDisk[#1, scale[#2]] & @@@ Values[ea]}]
Out[13]=

Related Examples

es fr ja ko pt-br ru zh