In our discussion with Tim, we talked about how “specific/fine scale” we need to be when using SST data in growth models. Tim wanted us to quantify the variation in temperature within a migration area. In other words, how well does the mean monthly temeprature of the entire migration area represent each cell within that area?
ERSST values (monthly mean for 2x2 latlong cells in entire North Atlantic 1960-2018)
ERSST mean for Atlantic salmon migration areas (monthly mean by migration area 1960-2018)
Atlantic salmon migration area shapefiles
ersst<-brick(paste(shared.path,"Mills Lab/Projects/Atlantic salmon/Shared data/migration area SST/ERSSTv5.grd",sep=""))
# get years from raster names
d<-substr(names(ersst),start=2,stop=11)
Dates<-c()
for(i in 1:length(d)){Dates<-c(Dates,paste(unlist(strsplit(d[i],"[.]")),collapse="-"))}
Dates<-as.Date(Dates)
yr<-year(Dates)
# select only years we want
#selyrs<-sort(unique(salmon$year))
selyrs<-seq(1966,2018,1)
ersstyears<-ersst[[which(yr%in%selyrs)]]
alltemps<-raster::as.data.frame(ersstyears, xy = TRUE, optional = TRUE, long = TRUE) %>%
tidyr::separate(col = "layer", into = c("empty","revisedlayer"), sep = "X", remove = T) %>%
mutate(date = lubridate::as_date(revisedlayer)) %>%
mutate(year = lubridate::year(date)) %>%
mutate(month = lubridate::month(date)) %>%
dplyr::select(x,y,date,year,month,value) %>%
dplyr::rename("long" = "x", "lat" = "y") %>%
filter(!is.na(value)) %>%
dplyr::rename("ERSST" = "value") %>%
left_join(monthtib, by = "month")
migarea_sst<-read_csv(paste(shared.path,"Mills Lab/Projects/Atlantic salmon/Shared data/migration area SST/migrationareasERSST.csv",sep = "")) %>%
dplyr::rename("date" = "Dates", "mig_area" = "Area", "mean_ERSST" = "ERSST") %>%
filter(date >= "1966-01-01",
date < "2018-12-01") %>%
mutate(year = year(date)) %>%
mutate(month = month(date)) %>%
left_join(monthtib, by = "month")
migarea.path<- switch(os.use,
"unix" = paste("~/Box/", user.name, sep = ""),
"windows" = paste("C:/Users/", computer.name, "/Box/Mills Lab/Projects/Atlantic salmon/Shared data/migration area SST/migrationareashapefiles/", sep = ""))
# migration area shapefiles
# Gulf of Maine
gom<-shapefile(paste(migarea.path,"gom.shp", sep = ""))
# Coast off Newfoundland
nf<-shapefile(paste(migarea.path,"nf.shp", sep = ""))
# N. Labrador Sea
n.labsea<-shapefile(paste(migarea.path,"nlabsea.shp", sep = ""))
# S. Labrador Sea
s.labsea<-shapefile(paste(migarea.path,"slabsea.shp", sep = ""))
# Coast off Greenland
wgreen<-shapefile(paste(migarea.path,"wgreen.shp", sep = ""))
#north atlantic
northatlantic<-shapefile(paste(migarea.path,"northatlantic.shp", sep = ""))
## [1] "SpatialPointsDataFrame"
## attr(,"package")
## [1] "sp"
migarealabs<-as_labeller(c("gom"="Gulf of Maine",
"nf"= "Newfoundland",
"n.labsea"= "North Labrador",
"s.labsea"= "South Labrador",
"wgreen" = "West Greenland"))
all_areas<-meandiffs %>%
mutate(mig_area = fct_relevel(mig_area, "gom","nf","s.labsea","n.labsea","wgreen")) %>%
group_by(mig_area,long,lat) %>%
summarise(mean_diff = mean(block_difference, na.rm = T))
ggplot(data = world) +
geom_tile(data = all_areas, aes(x=long, y=lat, fill=mean_diff)) + geom_sf() +
coord_sf(xlim = c(-73,-41),ylim = c(41,73),expand = FALSE) +
facet_wrap(~mig_area, ncol = 5, labeller = migarealabs) +
scale_fill_gradient2(midpoint = 0, low = "#00608a", mid = "#E5EEF2", high = "#BB3F0E") +
scale_x_continuous(breaks = c(-70,-60,-50)) +
scale_y_continuous(breaks = c(50,60,70)) + LGCtheme +
theme(panel.grid = element_blank()) + theme(axis.text = element_text(size=12),
axis.title = element_text(size=12), strip.text = element_text(size=12)) +
labs(x="",y="",fill = "degrees C", title = "ERSST difference between cell and migration area")
Not surprisingly, the small migration areas have minimal variation. The largeer migration areas, especialy those which span a large gradient of water temperatures (South Labrador) are not well-represented by the migration area mean (~7.5 degrees of variation).
na_diffs<-na_df %>%
mutate(decade = 10 * year %/% 10) %>%
group_by(decade,long,lat) %>%
summarise(mean_diff = mean(block_difference, na.rm = T))
ggplot(data = world) +
geom_tile(data = na_diffs, aes(x=long, y=lat, fill=mean_diff)) + geom_sf() +
coord_sf(xlim = c(-73,-41),ylim = c(41,73),expand = FALSE) + facet_wrap(~decade, ncol = 7) +
scale_fill_gradient2(midpoint = 0, low = "#00608a", mid = "#E5EEF2", high = "#BB3F0E") +
scale_x_continuous(breaks = c(-70,-60,-50)) +
scale_y_continuous(breaks = c(50,60,70)) + LGCtheme +
theme(panel.grid = element_blank()) + theme(axis.text = element_text(size=12),
axis.title = element_text(size=12), strip.text = element_text(size=12)) +
labs(x="",y="",fill = "degrees C", title = "ERSST difference between cell and North Atlantic]")
Across the entire North Atlantic, there is 15 degrees in variation from the mean North Atlantic monthly temeprature. However, this pattern does not appear to change over time.
migarea_gridlabs<-as_labeller(c("gom"="Gulf of Maine",
"nf"= "Newfoundland",
"n.labsea"= "North Labrador",
"s.labsea"= "South Labrador",
"wgreen" = "West Greenland",
"1960" = "1960",
"1970" = "1970",
"1980" = "1980",
"1990" = "1990",
"2000" = "2000",
"2010" = "2010"
))
decadal_differences<-meandiffs %>%
mutate(decade = 10 * year %/% 10) %>%
mutate(mig_area = fct_relevel(mig_area, "gom","nf","s.labsea","n.labsea","wgreen")) %>%
group_by(mig_area,decade,long,lat) %>%
summarise(mean_diff = mean(block_difference, na.rm = T))
ggplot(data = world) +
geom_tile(data = decadal_differences, aes(x=long, y=lat, fill=mean_diff)) + geom_sf() +
coord_sf(xlim = c(-73,-41),ylim = c(41,73),expand = FALSE) +
facet_grid(cols = vars(decade), rows = vars(mig_area), labeller = migarea_gridlabs) +
scale_fill_gradient2(midpoint = 0, low = "#00608a", mid = "#E5EEF2", high = "#BB3F0E") +
scale_x_continuous(breaks = c(-70,-60,-50)) +
scale_y_continuous(breaks = c(50,60,70)) + LGCtheme +
theme(panel.grid = element_blank()) + theme(axis.text = element_text(size=12),
axis.title = element_text(size=12), strip.text = element_text(size=12)) +
labs(x="",y="",fill = "degrees C", title = "ERSST difference between cell and migration area")
As with the North Atlantic, the variation within the migration area doesn’t seem to be changing over time.
meandiffs %>%
mutate(block = paste(lat,abs(long), sep = "_")) %>%
mutate(mig_area = fct_relevel(mig_area, "gom","nf","s.labsea","n.labsea","wgreen")) %>%
group_by(mig_area,block) %>%
summarise(mean_diff = mean(block_difference,na.rm = T), sd = sd(block_difference,na.rm = T)) %>%
ggplot(aes(x=block, y = mean_diff, color = mean_diff)) +
geom_hline(yintercept = 2, lty = 2, color = "grey") + geom_hline(yintercept = -2, lty = 2, color = "grey") +
geom_hline(yintercept = 0, color = "grey") + geom_point(size=2.8) +
geom_errorbar(aes(ymin=mean_diff-sd,ymax=mean_diff+sd),width = 0.32) + coord_flip() +
facet_wrap(~mig_area, scales = "free_y", ncol = 3, labeller = migarealabs) +
scale_color_gradient2(midpoint = 0, low = "#00608a", mid = "#E5EEF2", high = "#BB3F0E") + LGCtheme +
labs(x= "Lat Long Pair", y = "ERSST difference between cell and migration area",
color = "degrees C") + theme(axis.text.y = element_text(size=10), strip.text = element_text(size=14), legend.title = element_text(size=13)) +
theme(legend.position = c(0.8,0.3))
Dotted vertical lines represent 2 degrees in variation around the mean migration area temeprature. The mean and standard deviation of each 2x2 cell’s difference from the migration area mean (~50 years) are colored by their mean.
meandiffs %>%
filter(!is.na(block_difference)) %>%
mutate(mo_name = fct_reorder(mo_name, month, .desc = T)) %>%
mutate(mig_area = fct_relevel(mig_area, "gom","nf","s.labsea","n.labsea","wgreen")) %>%
ggplot(aes(x=block_difference, y=mo_name)) +
ggridges::stat_density_ridges(quantile_lines = T, quantiles = c(0.05, 0.95)) +
facet_wrap(~mig_area, ncol = 5, labeller = migarealabs) +
labs(x= "ERSST difference between cell and migration area", y = "Month") + LGCtheme
Distribution of ERSST difference between cell and migration area mean by month and migration area.
Min_difference = minimum value of difference between the 2x2 cell monthly ERSST value and migration area monthly mean
Max_difference = maximum value of difference between the 2x2 cell monthly ERSST value and migration area monthly mean
Percent<-2 = Percent of monthly cell observations that are less than 2 degrees below the migration area mean
Percent>2 = Percent of monthly cell observations that are more than 2 degrees above the migration area mean
Total_cellmonths = Total number of monthly cell observationss in each migration area
meandiffs %>%
filter(!is.na(block_difference)) %>%
mutate(below = ifelse(block_difference<=-2, 1,0)) %>%
mutate(above = ifelse(block_difference>=2, 1,0)) %>%
group_by(mig_area) %>%
summarise(Min_difference = min(block_difference), Max_difference = max(block_difference), below=sum(below), above=sum(above),Total_cellmonths=n()) %>%
mutate(below=below/Total_cellmonths) %>%
mutate(above = above/Total_cellmonths) %>%
mutate_at(2:5, round,2) %>%
dplyr::rename("Percent<-2" = "below", "Percent>2" = "above", "Migration_area" = "mig_area") %>%
formattable(align = "l")
| Migration_area | Min_difference | Max_difference | Percent<-2 | Percent>2 | Total_cellmonths |
|---|---|---|---|---|---|
| gom | -2.60 | 2.91 | 0.01 | 0.02 | 4445 |
| n.labsea | -6.19 | 6.03 | 0.13 | 0.18 | 19685 |
| nf | -6.56 | 3.56 | 0.11 | 0.12 | 8255 |
| s.labsea | -6.50 | 7.18 | 0.27 | 0.23 | 13970 |
| wgreen | -3.46 | 1.66 | 0.03 | 0.00 | 5715 |
idealtemps<-alltemps %>%
mutate(isotherm = ifelse(ERSST <= 8 & ERSST >= 4, "ideal", "not ideal")) %>%
mutate(mo_name = fct_reorder(mo_name, month, .desc = F))
ggplot(data = world) +
geom_tile(data = idealtemps, aes(x=long, y=lat, fill=isotherm)) + geom_sf() +
coord_sf(xlim = c(-73,-41),ylim = c(41,73),expand = FALSE) +
facet_wrap(~mo_name, ncol = 4) + labs(x="",y="") +
scale_fill_manual(values = c("#9ecae1","#fafafa")) +
scale_x_continuous(breaks = c(-70,-60,-50)) +
scale_y_continuous(breaks = c(50,60,70)) + LGCtheme + theme(legend.position = "none") +
theme(panel.grid = element_blank()) + theme(axis.text = element_text(size=12),
axis.title = element_text(size=12), strip.text = element_text(size=12))
The shaded blue are represents cells which contain ideal thermal habitat for salmon (4-8C).
alltemps %>%
mutate(isotherm = ifelse(ERSST <= 8 & ERSST >= 4, "ideal", "not ideal")) %>%
mutate(mo_name = fct_reorder(mo_name, month, .desc = F)) %>%
group_by(year,mo_name,isotherm) %>%
summarise(n=n()) %>%
filter(isotherm == "ideal") %>%
ggplot(aes(x=year, y = n)) + geom_line() + facet_wrap(~mo_name) +
geom_smooth(method = "lm", se = F, color = "black") + LGCtheme +
scale_x_continuous(breaks = c(1970,1990,2010)) +
labs(x="Year", y = "Number of cells where 4 >= ERSST <= 8")
The number of cells with ideal thermal habitat for salmon (4-8C) has been increasing.
The number of 2x2 lat-long cells where ERSST is within the preferred thermal range for Atlantic salmon (4-8C) is increasing for all month.
It doesn’t seem appropriate to use the entire North Atlantic mean ERSST as a proxy for temperature that salmon are experience because the variation is so great.
It seems appropriate to use mean migration area temperatures for homogenous environments like the Gulf of Maine and West Greenland. However, I think we need to be more specific in our use of of ERSST data for migration areas like North and South Labrador. A difference of 7.5 degrees seems like it would make a biologically signficiant difference to a salmon.
Another idea is to use isotherms as rather than raw ERSSTs. However, without any biological context, this may be misleading. Though there are more cells within the “preferred thermal range,” it doesn’t necessarily mean that salmon habitat is expanding. It seems like that cells within the possible thermal range have litte habitat value for salmon due to lack of appropriate food sources, or distance from migratory pathways.