library(pacea)
library(dplyr)
library(tibble) # Else prints all of a tibble
library(ggplot2)In pacea we include daily average sea surface temperature (SST) that we have calculated from measurement from 19 buoys in Canadian Pacific waters, yielding over 200,000 daily means. Data are from Environment and Climate Change Canada, and Fisheries and Oceans Canada. The earliest data are from September 1987, and 14 buoys were still providing data as of May 2023.
Metadata for the buoys is given by
buoy_metadata
#> # A tibble: 19 × 9
#> wmo_id name type latitude longitude water_depth_m col_key stn_id name_key
#> <fct> <fct> <fct> <dbl> <dbl> <dbl> <fct> <fct> <fct>
#> 1 46004 Middle… NOMAD 51.0 -136. 3600 #0000FF C46004 C46004 …
#> 2 46036 South … NOMAD 48.4 -134. 3500 #FF0000 C46036 C46036 …
#> 3 46131 Sentry… 3 me… 49.9 -125. 18 #00FF00 C46131 C46131 …
#> 4 46132 South … 3 me… 49.7 -128. 2040 #000033 C46132 C46132 …
#> 5 46134 ECOBUO… 3 me… 48.7 -123. 65 #000033 C46134 C46134 …
#> 6 46145 Centra… 3 me… 54.4 -132. 257 #FF00B6 C46145 C46145 …
#> 7 46146 Halibu… 3 me… 49.3 -124. 43 #005300 C46146 C46146 …
#> 8 46147 South … 3 me… 51.8 -131. 2000 #FFD300 C46147 C46147 …
#> 9 46181 Nanakw… 3 me… 53.8 -129. 22 #009FFF C46181 C46181 …
#> 10 46183 North … 3 me… 53.6 -131. 60 #9A4D42 C46183 C46183 …
#> 11 46184 North … NOMAD 53.9 -139. 3200 #00FFBE C46184 C46184 …
#> 12 46185 South … 3 me… 52.4 -130. 228 #783FC1 C46185 C46185 …
#> 13 46204 West S… 3 me… 51.4 -129. 222 #1F9698 C46204 C46204 …
#> 14 46205 West D… 3 me… 54.2 -134. 2675 #FFACFD C46205 C46205 …
#> 15 46206 La Per… 3 me… 48.8 -126. 73 #FE8F42 C46206 C46206 …
#> 16 46207 East D… 3 me… 50.9 -130. 2215 #DD00FF C46207 C46207 …
#> 17 46208 West M… 3 me… 52.5 -133. 2950 #02AD24 C46208 C46208 …
#> 18 46303 S. Geo… <NA> 49.0 -123. NA #C8FF00 C46303 C46303 …
#> 19 46304 Entran… <NA> 49.3 -123. NA #886C00 C46304 C46304 …which includes each buoy’s World Meteorological Organisation’s weather station id (wmo_id), its ‘common name’ (name), location, and depth of the water in which the buoy resides. See ?buoy_metadata for descriptions of all columns. The full names of all buoys are
buoy_metadata$name
#> [1] Middle NOMAD South NOMAD Sentry Shoal
#> [4] South Brooks ECOBUOY_1 Central Dixon Entrance
#> [7] Halibut Bank South Moresby Nanakwa Shoal
#> [10] North Hecate Strait North NOMAD South Hecate Strait
#> [13] West Sea Otter West Dixon Entrance La Perouse Bank
#> [16] East Dellwood Knolls West Moresby S. Georgia Strait
#> [19] Entrance English Bay
#> 19 Levels: Central Dixon Entrance East Dellwood Knolls ... West Sea OtterThe locations of the buoys are given by
(built with code in data-raw/buoys/buoys-map.R), and also shown at https://github.com/IOS-OSD-DPG/Pacific_SST_Monitoring#eccc-buoy-data.
Some of the recent data are also plotted on that website, by Andrea Hilborn, Charles Hannah and Lu Guan, which is automatically updated roughly every week (so look there for a quick glance at recent conditions). For pacea we have, with Andrea, adapted some of that code to include the data and create plotting functions in our package.
The wrangling of data is taken care of within pacea, and includes using protocols to remove certain flagged data, dealing with timezones and pesky daylight savings time changes, and averaging over a day (the original raw data are even higher resolution). We are still refining this to remove outliers – this has to be somewhat manual.
The sst value are saved in a tibble, which also has class pacea_buoy
buoy_sst
#> # A tibble: 206,901 × 3
#> date stn_id sst
#> <date> <fct> <dbl>
#> 1 1988-08-05 C46004 12.8
#> 2 1988-08-06 C46004 12.7
#> 3 1988-08-07 C46004 12.5
#> 4 1988-08-08 C46004 12.5
#> 5 1988-08-09 C46004 12.6
#> 6 1988-08-10 C46004 12.6
#> 7 1988-08-11 C46004 12.7
#> 8 1988-08-12 C46004 12.7
#> 9 1988-08-13 C46004 12.8
#> 10 1988-08-14 C46004 12.9
#> # ℹ 206,891 more rows
tail(buoy_sst)
#> # A tibble: 6 × 3
#> date stn_id sst
#> <date> <fct> <dbl>
#> 1 2024-09-14 C46304 17.0
#> 2 2024-09-15 C46304 16.8
#> 3 2024-09-16 C46304 16.2
#> 4 2024-09-17 C46304 15.0
#> 5 2024-09-18 C46304 15.4
#> 6 2024-09-19 C46304 15.3with stn_id specifying each buoy as described above in buoy_metadata, and date based on UTC -8 hours (i.e. Pacific Standard Time, not changing due to daylight savings), and sst is the mean SST (deg C) for that day at that station; see ?buoy_sst for full details.
To see the ranges of dates for each buoy, use dplyr functions in the usual way:
buoy_ranges <- buoy_sst %>%
group_by(stn_id) %>%
summarise(start = min(date),
end = max(date))
buoy_ranges
#> # A tibble: 19 × 3
#> stn_id start end
#> <fct> <date> <date>
#> 1 C46004 1988-08-05 2023-06-17
#> 2 C46036 1987-09-23 2024-07-09
#> 3 C46131 1992-10-20 2024-09-19
#> 4 C46132 1994-09-07 2024-09-19
#> 5 C46134 2001-02-20 2016-12-08
#> 6 C46145 1991-04-17 2024-09-19
#> 7 C46146 1992-03-14 2024-09-19
#> 8 C46147 1993-06-17 2024-09-19
#> 9 C46181 1988-12-07 2024-09-19
#> 10 C46183 1991-05-15 2023-12-11
#> 11 C46184 1987-09-21 2024-05-28
#> 12 C46185 1991-09-13 2024-09-19
#> 13 C46204 1989-09-08 2024-01-21
#> 14 C46205 1988-11-23 2024-09-19
#> 15 C46206 1988-11-23 2024-09-19
#> 16 C46207 1989-10-18 2022-09-07
#> 17 C46208 1990-07-12 2023-08-03
#> 18 C46303 2019-10-01 2024-07-26
#> 19 C46304 2019-10-02 2024-09-19Plot data from a single buoy for all years, the default is for buoy C46205:
plot(buoy_sst)The red line gives the current year. Since buoy_sst has class pacea_buoy, plot(buoy_sst) function calls our tailored plot.pacea_buoy() function. The gap in the red line at the start of the year indicates missing data (or days that get excluded due to our protocols).
To see data from each buoy in turn:
for(i in 1:nrow(buoy_metadata)){
plot(buoy_sst,
stn_id = buoy_metadata[i, ]$stn_id) %>% print()
}#> Warning: Removed 33 rows containing missing values or values outside the scale range
#> (`geom_line()`).
We might adapt Andrea Hilborn’s code (saved below in the .Rmd) to produce a panel plot of all buoys at once, to give a figure resembling that at https://github.com/IOS-OSD-DPG/Pacific_SST_Monitoring/blob/main/figures/current/Daily_mean_buoy_overview_2023.png. But for pacea users the individual buoys are probably sufficient.