Introduction

Galeras and Popocatepetl are two extremely active volcanos. SO2 gas emmisions trends can hold value in predicting volcanic eruptions in the future. This code does a series of simple data anaylsese of the SO2 flux data set from NOVAC (Network for Observation of Volcanic and Atmospheric Change) for both Galeras and Popocatepetl.

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)

Read Data: Yearly SO2 Emmisions 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 Emmisions 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(691:701)
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 Yearly SO2 Emmisions Galeras vs 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 Yearly SO2 Emmisions Galeras vs Popcatepetl Side-by-side plots

library(gridExtra)

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 Yearly SO2 Emmisions Galeras vs Popcatepetl

arraysumgaleras <- sum(array4)
arraysumpopocatepetl <- sum(array2)

SumGaleras <- 6113.79
SumPopocatepetl <- 20087.76
totalemissions <- array(data = c(SumGaleras, SumPopocatepetl), 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)

Popcatepetl Total SO2 Emmisions by 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

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 Emmisions 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)

Discussion

Galeras and Popocatepetl are two extremely active volcanos. SO2 gas emmisions can hold value in predicting volcanic eruptions in the future. Galera’s daily SO2 trend is remarkable throughout the six years because it shows a huge peak in SO2 gas emmissions around 2008, during this time there was a volcanic eruption. Popocatepetl’s daily SO2 emmisions differs from Galeras with its trend being consistently high. Galera’s and Popocatepetl total of SO2 throughout the six years differed by an order of magntitude with Popocatepetl being higher.