Introduction

SO2 gas emission measurements near volcanos can provide many understandings of volcanic eruptions and hazards. When recorded, the trends of these measurements can hold value in predicting future volcanic eruptions. Two volcanos that have many years of SO2 gas measurements is Galeras,Volcano in Colombia and Popocatepetl, Volcano in Mexico. Galeras and Popocatepetl are two extremely active volcanos that have many data to anaylze to provide much insight into SO2 trends of volcanos around the world.

This code does a series of simple data analyses of the SO2 flux data set from NOVAC (Network for Observation of Volcanic and Atmospheric Change) for both Galeras and Popocatepetl. NOVAC takes daily measurements of SO2 using specometers that measure emmited SO2 wavelengths. This code aims to identify trends from Galeras and Popocatepetl from the years 2008-2013. These two volcanos and years were picked because it has the most data and the largest overlap of time.

Outline:

1: Daily Mean Trends of SO2 for Galeras and Popocatepetl
2. Yearly Trends of SO2 for Galeras and Popocatepetl
3. Total Sum of SO2 of Galeras and Popocatepetl
4. Histogram of Yearly Trends
5. Dicussion

Source: Chacon, Z., Arellano, S., Burbano, V., Garzon, G., Laverde, C., Galle, B., SO2 flux of -GALERAS- volcano, from the NOVAC data-base; 2020; [Data set]; v.001; doi:10.17196/novac.galeras.001

Load Packages

library(ncdf4)
library(ggplot2)
library(gridExtra)
library(maps)

Read Data: Yearly SO2 Emissions for Galeras and Popocatepetl

Open the Galeras NetCDF file

ncfile <- nc_open("groundbased_novac.scandoas.so2_sgc013_galeras_20071114t000000z_20140329t000000z_001.nc")
variable_data <- ncvar_get(ncfile, "SO2.FLUX_SCANNING.DOAS_DAILY.MEAN")
DATETIME_data <- ncvar_get(ncfile, "DATETIME")

Open the Popcatepetl NetCDF file

ncfile <- nc_open("groundbased_novac.scandoas.so2_unam032_popocatepetl_20070412t000000z_20161228t000000z_001.nc")
 
variable_data2 <- ncvar_get(ncfile, "SO2.FLUX_SCANNING.DOAS_DAILY.MEAN")
DATETIME_data2 <- ncvar_get(ncfile, "DATETIME")

Trim Data: 2008-2013 Yearly SO2 Emissions for Galeras and Popocatepetl

Get Galeras DATETIME variable into years.

divide_array <- DATETIME_data / 365
finaltime_array <- divide_array + 2000

Trim Galeras new variable years down to 2008-2013

rows_to_remove3 <- c(698:704)
x3array <- finaltime_array[-rows_to_remove3]
array3 <- variable_data[-rows_to_remove3]

rows_to_remove5 <- c(1:9)
x4array <- x3array[-rows_to_remove5]
array4 <- array3[-rows_to_remove5]

Get DATETIME Popcatepetl into Years

divide_array2 <- DATETIME_data2 / 365
finaltime_array2 <- divide_array2 + 2000

Trim Popcatepetl new variable years down to 2008-2013

rows_to_remove <- c(1:151)
array <- finaltime_array2[-rows_to_remove]
xarray <- variable_data2[-rows_to_remove]

rows_to_remove2 <- c(882:1057)
array2 <- array[-rows_to_remove2]
x2array <- xarray[-rows_to_remove2]

Plot Mean Daily SO2 Emissions Galeras and Popcatepetl

ggplot() +
  geom_line(aes(x = (x4array), y = array4)) + labs(title="Galeras Daily SO2 Measurements vs Date(Year)", x = "Date (Year)", y = "SO2 Flux (kg/s)") + scale_x_continuous(breaks= round(seq(min(2007), max(2015),by = 1)))

ggplot() +
    geom_line(aes(x = (array2), y = x2array)) + labs(title="Popocatepetl Daily SO2 Measurements vs Date(Year)", x = "Date (Year)", y = "SO2 Flux (kg/s)") + scale_x_continuous(breaks= round(seq(min(2007), max(2014), by = 1)))

Plot Daily SO2 Emmisions Galeras vs Popcatepetl Side-by-side plots

plot1 <- ggplot() +
  geom_line(aes(x = (x4array), y = array4)) + labs(title="Galeras Daily SO2 Measurements vs Date(Year)", x = "Date (Year)", y = "SO2 Flux (kg/s)") + scale_x_continuous(breaks= round(seq(min(2007), max(2015),by = 1)))
plot2 <- ggplot() +
    geom_line(aes(x = (array2), y = x2array)) + labs(title="Popocatepetl Daily SO2 Measurements vs Date(Year)", x = "Date (Year)", y = "SO2 Flux (kg/s)") + scale_x_continuous(breaks= round(seq(min(2007), max(2014), by = 1)))
grid.arrange(plot1, plot2, ncol=2)

Total Popcatepetl SO2 Emmisions by Year

Categorize Popocatepetl data into year and sum data for each year.

2008

rows_to_removepop2008 <- c(201:881)
arraypop2008 <- x2array[-rows_to_removepop2008]
yarraypop2008 <- array2[-rows_to_removepop2008]
arraysumpop2008 <- sum(yarraypop2008)

2009

rows_to_removepop2009 <- c(371:881)
arraypop2009 <- x2array[-rows_to_removepop2009]
yarraypop2009 <- array2[-rows_to_removepop2009]
rows_to_removepop2009p2 <- c(1:211)
arraypop2009pt2 <- arraypop2009[-rows_to_removepop2009p2]
yarraypop2009pt2 <- yarraypop2009[-rows_to_removepop2009p2]
arraysumpop2009 <- sum(yarraypop2009pt2)

2010

rows_to_removepop2010 <- c(531:881)
arraypop2010 <- x2array[-rows_to_removepop2010]
yarraypop2010 <- array2[-rows_to_removepop2010]
rows_to_removepop2010p2 <- c(1:381)
arraypop2010pt2 <- arraypop2010[-rows_to_removepop2010p2]
yarraypop2010pt2 <- yarraypop2010[-rows_to_removepop2010p2]
arraysumpop2010 <- sum(yarraypop2010pt2)

2011

rows_to_removepop2011 <- c(711:881)
arraypop2011 <- x2array[-rows_to_removepop2011]
yarraypop2011 <- array2[-rows_to_removepop2011]
rows_to_removepop2011p2 <- c(1:531)
arraypop2011pt2 <- arraypop2011[-rows_to_removepop2011p2]
yarraypop2011pt2 <- yarraypop2011[-rows_to_removepop2011p2]
arraysumpop2011 <- sum(yarraypop2011pt2)

2012

rows_to_removepop2012 <- c(811:881)
arraypop2012 <- x2array[-rows_to_removepop2012]
yarraypop2012 <- array2[-rows_to_removepop2012]
rows_to_removepop2012p2 <- c(1:711)
arraypop2012pt2 <- arraypop2012[-rows_to_removepop2012p2]
yarraypop2012pt2 <- yarraypop2012[-rows_to_removepop2012p2]
arraysumpop2012 <- sum(yarraypop2012pt2)

2013

rows_to_removepop2013 <- c(1:821)
arraypop2013 <- x2array[-rows_to_removepop2013]
yarraypop2013 <- array2[-rows_to_removepop2013]
arraysumpop2013 <- sum(yarraypop2013)

Total Galeras SO2 Emmisions by Year

Categorize Galeras data into year and sum data for each year.

2008

rows_to_removeg2008 <- c(191:651)
arrayg2008 <- x2array[-rows_to_removeg2008]
yarrayg2008 <- array2[-rows_to_removeg2008]
arraysumg2008 <- sum(yarrayg2008)

2009

rows_to_removeg2009 <- c(361:651)
arrayg2009 <- x2array[-rows_to_removeg2009]
yarrayg2009 <- array2[-rows_to_removeg2009]
rows_to_removeg2009p2 <- c(1:181)
arrayg2009pt2 <- arrayg2009[-rows_to_removeg2009p2]
yarrayg2009pt2 <- yarrayg2009[-rows_to_removeg2009p2]
arraysumg2009 <- sum(yarrayg2009pt2)

2010

rows_to_removeg2010 <- c(401:651)
arrayg2010 <- x2array[-rows_to_removeg2010]
yarrayg2010 <- array2[-rows_to_removeg2010]
rows_to_removeg2010p2 <- c(1:351)
arrayg2010pt2 <- arrayg2010[-rows_to_removeg2010p2]
yarrayg2010pt2 <- yarrayg2010[-rows_to_removeg2010p2]
arraysumg2010 <- sum(yarrayg2010pt2)

2011

rows_to_removeg2011 <- c(491:881)
arrayg2011 <- x2array[-rows_to_removeg2011]
yarrayg2011 <- array2[-rows_to_removeg2011]
rows_to_removeg2011p2 <- c(1:391)
arrayg2011pt2 <- arrayg2011[-rows_to_removeg2011p2]
yarrayg2011pt2 <- yarrayg2011[-rows_to_removeg2011p2]
arraysumg2011 <- sum(yarrayg2011pt2)

2012

rows_to_removeg2012 <- c(631:881)
arrayg2012 <- x2array[-rows_to_removeg2012]
yarrayg2012 <- array2[-rows_to_removeg2012]
rows_to_removeg2012p2 <- c(1:481)
arrayg2012pt2 <- arrayg2012[-rows_to_removeg2012p2]
yarrayg2012pt2 <- yarrayg2012[-rows_to_removeg2012p2]
arraysumg2012 <- sum(yarrayg2012pt2)

2013

rows_to_removeg2013 <- c(1:621)
arrayg2013 <- x2array[-rows_to_removeg2013]
yarrayg2013 <- array2[-rows_to_removeg2013]
arraysumg2013 <- sum(yarrayg2013)

Sum of Total SO2 Emmisions by Year for Galeras and Popocatepetl

galerastotalemissions <- array(data = c(arraysumg2008,arraysumg2009,arraysumg2010,arraysumg2011,arraysumg2012,arraysumg2013), dim= c(6,1))

popocatepetltotalemissions <- array(data = c(arraysumpop2008,arraysumpop2009,arraysumpop2010,arraysumpop2011,arraysumpop2012,arraysumpop2013), dim= c(6,1))

Plot Sum of Total SO2 Emissions by Year for Galeras and Popocatepetl

ggplot() +
     geom_point(aes(x = (2008:2013), y = popocatepetltotalemissions)) + labs(title=" Popocatepetl Total SO2 Emissions Per Year", x = "Year", y = "SO2 Flux (kg/s)") + scale_x_continuous(breaks= round(seq(min(2008), max(2013), by = 1))) + theme_bw() + geom_point(size = 7)

ggplot() +
     geom_point(aes(x = (2008:2013), y = galerastotalemissions)) + labs(title=" Galeras Total SO2 Emissions Per Year", x = "Year", y = "SO2 Flux (kg/s)") + scale_x_continuous(breaks= round(seq(min(2008), max(2013), by = 1))) + theme_bw() + geom_point(size = 7)

Total 6 Year SO2 Emissions Galeras vs Popcatepetl

arraysumgaleras <- sum(array4)
arraysumpopocatepetl <- sum(x2array)
print(arraysumgaleras)
## [1] 6260.133
print(arraysumpopocatepetl)
## [1] 20072.05
totalemissions <- array(data = c(arraysumgaleras, arraysumpopocatepetl), dim = c(2,2))


ggplot() +
   geom_point(aes(x = (2:2), y = totalemissions)) + labs(title="Galeras vs Popocatepetl Total SO2 6 Year Emissions", x = "Galeras (Below) vs Popocatepetl (Above)", y = "SO2 Flux (kg/s)") + scale_x_continuous(breaks= round(seq(min(0), max(2), by = 1))) + theme_bw() + geom_point(size = 7)

Histogram of Galeras and Popocatepetl Data

Popocatepetl <- array2
Galeras <- x4array
hist(Popocatepetl, breaks=20)

hist(Galeras, breaks=20)

Discussion

Galeras and Popocatepetl are two extremely active volcanos. SO2 gas emmisions can hold value in predicting volcanic eruptions and health risk of SO2 in the future. Map of Galeras,Volcano in Colombia and Popocatepetl, Volcano in Mexico to show the location where both SO2 trends and volcanic eruptions may be effecting.

world_map <- map_data("world")
point_data <- data.frame(
    lon = c(-77.36, -98.62),
    lat = c(1.22, 19.02)
 )

ggplot() +
    geom_polygon(data = world_map, aes(x = long, y = lat, group = group), fill = "lightblue") +
    geom_point(data = point_data, aes(x = lon, y = lat), color = "red", size = 3)