AIM : XX Document Note : The maps, plots and app within this document are interactive so make sure you give them a play like zooming in and out in the maps but also on the plots. Clicking on the legend allows to only select and display the time series needed.
(Calculate/estimate attributes for MHW using same methodology as Gupta et al. 2020)(#NZMHW)
Data - Downloading and Preparing NOAA OISST Data By Robert W Schlegel and AJ Smit From https://robwschlegel.github.io/heatwaveR/articles/OISST_preparation.html
Event Detection - Uses heatwaveR::, translation of GitHub python functions from Eric C.J. Oliver (published in paper Holbrook et al. (2019) A global assessment of marine heatwaves and their drivers) https://robwschlegel.github.io/heatwaveR/articles/gridded_event_detection.html
The file MHW_Events_NZ.csv is the output of the function event_only() from Robert W Schlegel and AJ Smit, used on data OISST around NZ (lat(-30, -51),lon(159, 179)) and using climatologyPeriod = c(“1982-01-01,” “2011-01-01”)
Here we load the resulting dataframe for gain of time
Let’s keep now the years with the longest (using column ‘duration’) and the most intense (using column ‘intensity_cumulative’) at every pixel.
## Position of Buoys
DT <- data.table(
place=c("M1", "M2", "M3", "M4","M5"),
longitude=c(174.913383333333, 175.148166666667, 175.312116666667, 175.500816666667, 175.75775),
latitude=c(-36.1809666666667, -35.8098333333333, -35.5358333333333, -35.2278666666667, -34.8114666666667))
DT_sf = st_as_sf(DT, coords = c("longitude", "latitude"),
crs = "+proj=longlat +datum=WGS84")
##
most_extreme_MHW_year_intensity <- read_csv('Most_ExtremeMHW_Year_CumInt_NZ.csv')
##
## -- Column specification --------------------------------------------------------
## cols(
## lon = col_double(),
## lat = col_double(),
## year = col_double(),
## max_intensity = col_double()
## )
## Plot
pal <- c(brewer.pal(9,'Purples'),brewer.pal(9,'Blues'),brewer.pal(9,'Oranges'),brewer.pal(8,'Reds'))
p_intensity <- ggplot() +
geom_tile(data=most_extreme_MHW_year_intensity,aes(x=lon,y=lat,fill=year)) +
scale_fill_gradientn(colours=pal) +
ggtitle('Year of Most Intense MHW events (1981-2020)') +
borders('world',xlim=c(170,180),ylim=c(-40,-30)) +
xlim(c(170,180)) + ylim(c(-40,-30)) +
geom_sf(data=DT_sf,col='grey',size=1.5) +
theme_bw()
ggplotly(p_intensity)
Figure 1 - Year of Most Intense MHW events around New Zealand North East Coast.
Highlights:
## OISST Time series in M1
pix_data <- read_csv('OISST_174E875_36S125_M1.csv')
##
## -- Column specification --------------------------------------------------------
## cols(
## lon = col_double(),
## lat = col_double(),
## t = col_date(format = ""),
## temp = col_double()
## )
##
## Detect event at this pixel
event <- function(df){
# First calculate the climatologies
#clim <- ts2clm(data = df, climatologyPeriod = c("1982-01-01", "2011-01-01"))
clim <- ts2clm(data = df, climatologyPeriod = c("1983-01-01", "2012-12-31"))
# Then the events
event <- detect_event(data = clim)
# Return only the event metric dataframe of results
#return(event$event)
return(event)
}
pix_event <- event(pix_data)
p <- event_line(pix_event, start_date = "2015-01-01", end_date = "2017-01-01", spread=500, category = TRUE) +
ggtitle('NOAA OISST time series + Climatology and Thresholds at (174.875;-36.125)') +
theme_bw()
p2 <- ggplot(pix_event$event, aes(x = date_peak, y = duration)) +
geom_lolli(aes(colour = intensity_cumulative)) +
#scale_color_distiller(palette = "Spectral", name = "Cumulative \nintensity") +
scale_color_viridis_c(option = 'magma',direction=-1,begin=0.1) +
xlab("Date") + ylab("Event duration [days]") +
geom_vline(xintercept=c(as.Date("2015-01-01"),as.Date("2017-01-01")),linetype="dashed", color = "grey", size=1) +
ggtitle('MHW Duration & Cumulative Intensity per events at (174.875;-36.125)') +
theme(legend.position = 'bottom')+
theme_bw()
grid.arrange(p2,p, ncol=1)
Figure 2 - MHW events around New Zealand North East Coast.
Highlights: