-
Notifications
You must be signed in to change notification settings - Fork 0
/
01-Chlorophyll-Concentration.qmd
123 lines (102 loc) · 4.31 KB
/
01-Chlorophyll-Concentration.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
---
title: "Chlorophyll-Concentration"
author: "[email protected]"
format:
docx:
reference-doc: Palau-Reference-Doc.docx
---
#add text
```{r}
#| include: false
### Load libraries
library(tidyverse)
library(lubridate)
library(here)
library(stringr)
#install.packages('remotes')
#remotes::install_github("nmfs-fish-tools/nmfspalette")
#https://github.com/nmfs-fish-tools/nmfspalette
library(nmfspalette)
library(rerddap)
```
```{r}
#| include: false
# Set report year (RptYr), to make things easier
RptYr <- 2022
# Set path to variable: Sea_Surface_Temperature
# This is where the data are and where the plots will go
Dir <- here("Chlorophyll_Concentration")
```
```{r}
#| include: false
### Load data
# Thanks to Melanie Abecassis and the OceanWatch training she led, whose code I'm borrowing here
# Bounding box, from John Marra via email:
lon_range <- c(129.4088, 137.0541)
lat_range <- c(1.5214, 11.6587)
# OceanWatch ERDDAP node
ERDDAP_Node <- "https://oceanwatch.pifsc.noaa.gov/erddap/"
# The variable name and other information can be found at the site above.
# I'm omitting the sleuthing from the code for the sake of brevity and
# because I'm familiar with the data.
# Access the data and all its attributes (this takes a bit)
chl_all <- griddap(url = ERDDAP_Node, 'esa-cci-chla-monthly-v6-0',
time = c('1998-01-01', paste(RptYr, '-12-01', sep = "")),
latitude = lat_range, longitude = lon_range,
fields = "chlor_a")
# Get just the chlorophyll data and its spatiotemporal coordinates
chl <- chl_all$data
```
```{r}
#| include: false
# Monthly spatial average
chl_ts <- chl |>
group_by(time) |>
summarise(chlor_a = mean(chlor_a, na.rm = TRUE))
```
```{r}
#| include: false
### Linear fit
n_obs <- seq(1, length(chl_ts$chlor_a), 1)
chl_lm <- lm(chl_ts$chlor_a ~ n_obs)
# summary(chl_lm) confirmed by a quick plot of the time series
# shows that there's no significant trend over time for this
# indicator. Therefore, I'm going to leave out the code
# related to quantifying and plotting change over time.
# This is something that can be added in in the future.
```
## __Indicator: Chlorophyll Concentration__
Phytoplankton are the foundation of the marine food web. Their abundance affects food
availability for all consumers, ranging from zooplankton to apex predators. Chlorophyll
concentration is used as a proxy for phytoplankton abundance. Some climate change
projections suggest a shift towards lower phytoplankton abundances, particularly in the
ocean’s oligotrophic gyres. Chlorophyll concentration (and phytoplankton abundance)
varies greatly across the Pacific basin, with higher concentrations generally found at
higher latitudes and particularly around coastlines. Chlorophyll concentrations also
vary in response to natural climate variability.
Chlorophyll-a concentration is estimated from satellite remotely sensed observations
of ocean color, which extend back to 1998. The basin-wide average (1998 – `r RptYr - 1`)
is shown below. The Palau EEZ is also highlighted as a spatial average (1998 – `r RptYr - 1`)
and a time series averaged over this area. No significant trend in chlorophyll concentration
was detected over this region and time span.
```{r}
#| echo: false
# Note that this needs to be 'echo' and not 'include' so the figure will show up
### Plot the time series
# Create axes limits to make things simpler
# These were determined through looking at quick rough plots and data limits
chl_xlim <- c(min(ymd_hms(chl_ts$time)), max(ymd_hms(chl_ts$time)))
chl_ylim <- c(0.05, 0.18)
# Access the NMFS color palette
oceans <- nmfs_palette("oceans")(3)
# Plot
plot(ymd_hms(chl_ts$time), chl_ts$chlor_a, type = "l", lwd = 2, col = oceans[2],
xlim = chl_xlim, ylim = chl_ylim, xlab = " ", ylab = "Chlorophyll-a Concentration (mg m^-^3)",
xaxt = "n", yaxt = "n", xaxs = "i", yaxs = "i")
axis((1), at = ymd_hms(chl_ts$time[seq(1, length(n_obs), 12)]), tck = 0.025, labels = year(make_date(seq(1998, RptYr, 1))))
axis((2), at = seq(0.05, 0.18, 0.01), tck = 0.025, las = 1)
axis((3), at = ymd_hms(chl_ts$time[seq(1, length(n_obs), 12)]), tck = 0.025, labels = FALSE)
axis((4), at = seq(0.05, 0.18, 0.01), tck = 0.025, labels = FALSE)
# _axt = "n" removes tick labels so that they can be customized later
# _axs = "i" removes whitespace beyond axes maxima
```