ABSTRACT: In this article, inspired by Arnoud Buzing's "Mapping Wildfires" and Mads Bahrami's "US Fire Map", I perform some data parsing, analysis and visualization on the data from the “INPE's Fire Database” that uses the NASA MODIS (Moderate Resolution Imaging Spectroradiometer) data to search for wildfires and automatically extract the geographical position, administrative division and the radioactive fire power. Through some parsing functions, the raw CSV dataset can be transformed into a more computable dataset with entities and quantities.

Introduction

Out[]=
Photography of “Illegal loggers, 2020” and “Apui fire, 2020” taken by Bruno Kelly.
The year of 2020 has been a cruel year, with both wildfires and criminal fires to all the six biomes of Brazil, the Atlantic Forest, Amazon, Pampa, Pantanal, Caatinga, and Cerrado. A couple of news articles claim devastating effects in the 2020 wildfires and criminal fires through all biomes, some include: “On 14 days of this month, the Amazon already has more wildfires than in all September of last year.”, “Burning Amazon 20: Burns consume trees and animals in southern Amazonas”, and “Wildfires leave deep marks in the Amazon”.
In this article, I’ll be analysing the complete NASA MODIS Land data from January 1st to August 31th of the year 2020, performing statistical analysis, and geographical visualization of the data.

Data Parsing

I’ve wrote one helper function that automatically parses the INPE’s Fire Database datasets into a more computable form of dataset, with entities and with the Wolfram Language knowledge.
Set the current directory to the notebook directory.
In[]:=
SetDirectory[NotebookDirectory[]]
Out[]=
/home/peter/Documents/WolframLLC/Articles/BrazillianWildfires
This notebook already contains this raw piece of data, so there is no need for importing or downloading.
Iconized March 2020 dataset.
In[]:=
RawMarchData=
;
Definition of the helper function ParseINPEDataset.
In[]:=
ParseINPEDataset`StateNames=
;
In[]:=
ParseINPEDataset[data_]:=Module[{parsed},​​​​(*Deleteafewcolumns.*)​​parsed=data〚All,{1,4,5,6,7,8,9,10,11,12}〛;​​​​(*Renameallcolumns.*)​​parsed〚1〛={"DateTime","State","County","Biome","DaysWithoutRain","RainIndex","FireRisk","GeoPosition","Longitude","FRP"};​​​​(*Interpretdatetimecolumn.*)​​parsed〚2;;,1〛=DateObject[ToExpression[StringTrim[#]]&/@StringSplit[#,{"/",":"," "}]]&/@parsed〚2;;,1〛;​​​​(*Changestatenamestoentities.*)​​parsed〚2;;,2〛=StringTrim[#]&/@parsed〚2;;,2〛;​​parsed〚2;;,2〛=parsed〚2;;,2〛//.ParseINPEDataset`StateNames;​​​​(*Translateandnormalizebiomenamestoenglish.*)​​parsed〚2;;,4〛=StringTrim[#]&/@parsed〚2;;,4〛;​​parsed〚2;;,4〛=parsed〚2;;,4〛/.{"Mata Atlantica""AtlanticForest","Amazonia""Amazon"};​​​​(*Convert"DaysWithoutRain"todays,replace-999toMissing["NotAvailable"].*)​​parsed〚2;;,5〛=If[MatchQ[#,-999]||MatchQ[#,"-999"]||MatchQ[#,""],Missing["NotAvailable"],Quantity[#,"Days"]]&/@parsed〚2;;,5〛;​​​​(*Convert"RainIndex"tomilimeters,replace-999toMissing["NotAvailable"].*)​​parsed〚2;;,6〛=If[MatchQ[#,-999]||MatchQ[#,"-999"]||MatchQ[#,""],Missing["NotAvailable"],Quantity[#,"Millimeters"]]&/@parsed〚2;;,6〛;​​​​(*Convert"FireRisk"topercentage,replace-999toMissing["NotAvailable"].*)​​parsed〚2;;,7〛=If[MatchQ[#,-999]||MatchQ[#,"-999"]||MatchQ[#,""],Missing["NotAvailable"],Quantity[100*#,"Percent"]]&/@parsed〚2;;,7〛;​​​​(*Join"Latitude"and"Longitude"intoasingle"GeoPosition"column.*)​​parsed〚2;;,8〛=parsed〚2;;,{8,9}〛;​​parsed〚2;;,8〛=GeoPosition[#]&/@parsed〚2;;,8〛;​​​​(*Convert"FRP"tomegawatts,replace-999toMissing["NotAvailable"].*)​​parsed〚2;;,10〛=If[MatchQ[#,-999]||MatchQ[#,"-999"]||MatchQ[#,""],Missing["NotAvailable"],Quantity[#,"Megawatts"]]&/@parsed〚2;;,10〛;​​​​(*Transformrowsintoanassociation.*)​​parsed〚2;;〛=AssociationThread[parsed〚1〛,#]&/@parsed〚2;;〛;​​​​(*Drop"Longitude"and"County"row.*)​​parsed=parsed〚2;;,{1,2,4,5,6,7,8,10}〛;​​​​(*Returnflawlesslyparseddataset.*)​​Return[SortBy[parsed,First]]​​​​];
For parsing the data, just call ParseINPEDataset with a proper INPE’s Fire Database CSV dataset.
Parse the first 10 elements of the unprocessed fire dataset with the ParseINPEDataset function.
In[]:=
Dataset[ParseINPEDataset[RawMarchData〚1;;11〛]]
Out[]=
DateTime
State
Biome
DaysWithoutRain
RainIndex
FireRisk
GeoPosition
FRP
Sun 1 Mar 2020 15:35:00
Pernambuco, Brazil
AtlanticForest
8days
1.4mm
90.
%
8.063°S 35.13°W
10.7MW
Sun 1 Mar 2020 15:35:00
Pernambuco, Brazil
AtlanticForest
9days
0mm
100
%
8.664°S 35.31°W
28.2MW
Sun 1 Mar 2020 15:35:00
Pernambuco, Brazil
AtlanticForest
9days
0mm
100
%
8.593°S 35.18°W
18.3MW
Sun 1 Mar 2020 15:35:00
Pernambuco, Brazil
AtlanticForest
9days
0mm
100
%
8.591°S 35.16°W
56.3MW
Sun 1 Mar 2020 17:10:00
Parana, Brazil
AtlanticForest
3days
1.4mm
50.
%
24.28°S 51.49°W
12.4MW
Sun 1 Mar 2020 17:10:00
Parana, Brazil
AtlanticForest
4days
0mm
80.
%
26.23°S 52.95°W
11.8MW
Sun 1 Mar 2020 17:10:00
Rio Grande Do Sul, Brazil
AtlanticForest
4days
0mm
—
29.23°S 51.34°W
14.8MW
Sun 1 Mar 2020 17:10:00
Rio Grande Do Sul, Brazil
AtlanticForest
4days
0mm
30.
%
29.47°S 51.48°W
16MW
Sun 1 Mar 2020 17:10:00
Rio Grande Do Sul, Brazil
Pampa
9days
0mm
90.
%
31.72°S 53.26°W
8MW
Sun 1 Mar 2020 17:10:00
Santa Catarina, Brazil
AtlanticForest
4days
0mm
20.
%
29.09°S 49.54°W
5.6MW

Downloading the Datasets

The dataset can be downloaded directly from the Wolfram Cloud. The file consists of a Wolfram Binary Dump, it’s a space and memory efficient way of holding computable data without any effort, the only downside is that you cannot read it as a raw file. This file will be monthly updated until the end of 2020 by me.
Define FireData as a CloudObject.
In[]:=
FireData=CloudObject["BrazilianFireData_2020.mx"]
Out[]=
CloudObject[
https://www.wolframcloud.com/obj/pcabral/BrazilianFireData_2020.mx
]
Information about the FireData CloudObject.
In[]:=
Information[FireData]
Out[]=
Cloud Object
f3bc4dba-e384-47e5-b7dd-a36ef3cd0c66
Path
pcabral/BrazilianFireData_2020.mx
Display Name
BrazilianFireData_2020.mx
Owner Cloud User UUID
02809256-05a7-4298-ac6d-bae97887163a
Owner Cloud User ID
pcabral@wolfram.com
MIME Type
File Type
File
File Byte Count
14206008
File Hash MD5
185975514566130149850085397421757189410
Created
Fri 2 Oct 2020 14:05:10GMT-3.
Last Accessed
Fri 2 Oct 2020 14:05:10GMT-3.
Last Modified
Fri 2 Oct 2020 14:25:48GMT-3.
Permissions
{All{Read},Owner{Read,Write,Execute}}
Active
True
For importing, you can use CloudImport[] or just import locally using Import[].
Retrieve the FireData CloudObject as BrazilianFireData.
Import the FireData Dataset as BrazilianFireData.

Dataset Information

The dataset is a list of associations, containing 8 rules. In terms of the Wolfram Language, the dataset is equivalent to a list of associations, containing 8 rules for each list. Here is a description of all columns.
Generate a dataset called ColumnsDescription with the description of all columns.
Get a random sample of the BrazilianFireData dataset.
Get five random samples of the BrazilianFireData dataset and display as a formatted dataset.

Dataset Segmentation

For the easiness of manipulation of the dataset, it’s possible to segment the data by month and date.
Segment the BrazilianFireData dataset into lists by month.
Segment the BrazilianFireData dataset into lists by day.

Statistical Analysis and Visualization

In this section, many statistical functions and different plotting methods will be applied on the dataset. For the easiness of visualization and interaction of this notebook, every interactive plot is saved, so it’s not necessary to run them again.
Let’s visualize the trend of the amount of fires per day, and the mean fire radiative power per day.
Plot a list line graphic of the amount of fires reported per day.
Plot a list line graphic of the mean fire radiative power per day.
Plot a histogram of the amount of days without rain.
Plot a bar chart of the fires and their biomes.

Data Querying and Comparison

Some interesting questions can be computationally extracted from the datasets.
Q: What was the most affected biome by the fires?
Dataset of the count for every biome from the reverse sorted dataset.
Q: What was the day that had the most fires? How many fires were there?
Q: What was the biggest period without rain?
Q: What was the biggest radiation emissive fire?

Geographical Visualization

For understanding better where the fires happened through the months, let’s geographically plot them using GeoGraphics[].
Define a function called NormalizeValue that normalizes a number based on minimum and maximum values.
Define a function called MonthFirePlot that plots the geographical position of all fires in a given month.
Make a side by side plot of the fires from January and September.
It’s also interesting to visualize the fires per biome, and differentiate the geographical points with colors for each of the six biomes.
Define a function called MonthFirePlot that plots the geographical position of all fires in a given month.
Make an animated list plot of the fires from January to August separated by biome.