-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from kdorheim/temp_smoothing
Tried smoothing temp data
- Loading branch information
Showing
10 changed files
with
381 additions
and
7 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
parameters values | ||
beta 0.528262342844422 | ||
q10_rh 1.76 | ||
diff 2.4 | ||
|
||
Objective Function Value: 2.32 | ||
|
||
CO2 MSE: 4.57 | ||
T MSE: 0.0772 | ||
RMSE: 2.14 | ||
|
||
***Key Metrics*** | ||
TCRE: 1.51 | ||
TCR: 1.76 | ||
|
||
***Historical Warming and ERF*** | ||
GSAT Warming: 0.73 | ||
Ocean Heat Content Change: 472 | ||
Total Aerosol ERF: -1.24 | ||
WMGHG ERF: 3.87 | ||
Methane ERF: 0.54 | ||
|
||
***Future Warming*** | ||
scenario start end GSAT | ||
ssp119 2021 2040 0.729 | ||
ssp119 2041 2060 0.894 | ||
ssp119 2081 2100 0.717 | ||
ssp126 2021 2040 0.744 | ||
ssp126 2041 2060 1.08 | ||
ssp126 2081 2100 1.1 | ||
ssp245 2021 2040 0.749 | ||
ssp245 2041 2060 1.29 | ||
ssp245 2081 2100 1.98 | ||
ssp370 2021 2040 0.76 | ||
ssp370 2041 2060 1.43 | ||
ssp370 2081 2100 2.93 | ||
ssp585 2021 2040 0.876 | ||
ssp585 2041 2060 1.74 | ||
ssp585 2081 2100 3.79 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
parameters values | ||
beta 0.528262550029036 | ||
q10_rh 1.76 | ||
diff 2.4 | ||
|
||
Objective Function Value: 2.3 | ||
|
||
CO2 MSE: 4.57 | ||
T MSE: 0.0772 | ||
RMSE: 2.14 | ||
|
||
***Key Metrics*** | ||
TCRE: 1.51 | ||
TCR: 1.76 | ||
|
||
***Historical Warming and ERF*** | ||
GSAT Warming: 0.73 | ||
Ocean Heat Content Change: 472 | ||
Total Aerosol ERF: -1.24 | ||
WMGHG ERF: 3.87 | ||
Methane ERF: 0.54 | ||
|
||
***Future Warming*** | ||
scenario start end GSAT | ||
ssp119 2021 2040 0.729 | ||
ssp119 2041 2060 0.894 | ||
ssp119 2081 2100 0.717 | ||
ssp126 2021 2040 0.744 | ||
ssp126 2041 2060 1.08 | ||
ssp126 2081 2100 1.1 | ||
ssp245 2021 2040 0.749 | ||
ssp245 2041 2060 1.29 | ||
ssp245 2081 2100 1.98 | ||
ssp370 2021 2040 0.76 | ||
ssp370 2041 2060 1.43 | ||
ssp370 2081 2100 2.93 | ||
ssp585 2021 2040 0.876 | ||
ssp585 2041 2060 1.74 | ||
ssp585 2081 2100 3.79 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
parameters values | ||
beta 0.528263386504877 | ||
q10_rh 1.76 | ||
diff 2.4 | ||
|
||
Objective Function Value: 2.32 | ||
|
||
CO2 MSE: 4.57 | ||
T MSE: 0.0772 | ||
RMSE: 2.14 | ||
|
||
***Key Metrics*** | ||
TCRE: 1.51 | ||
TCR: 1.76 | ||
|
||
***Historical Warming and ERF*** | ||
GSAT Warming: 0.73 | ||
Ocean Heat Content Change: 472 | ||
Total Aerosol ERF: -1.24 | ||
WMGHG ERF: 3.87 | ||
Methane ERF: 0.54 | ||
|
||
***Future Warming*** | ||
scenario start end GSAT | ||
ssp119 2021 2040 0.729 | ||
ssp119 2041 2060 0.894 | ||
ssp119 2081 2100 0.717 | ||
ssp126 2021 2040 0.744 | ||
ssp126 2041 2060 1.08 | ||
ssp126 2081 2100 1.1 | ||
ssp245 2021 2040 0.749 | ||
ssp245 2041 2060 1.29 | ||
ssp245 2081 2100 1.98 | ||
ssp370 2021 2040 0.76 | ||
ssp370 2041 2060 1.43 | ||
ssp370 2081 2100 2.93 | ||
ssp585 2021 2040 0.876 | ||
ssp585 2041 2060 1.74 | ||
ssp585 2081 2100 3.79 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
parameters values | ||
beta 0.528261345579967 | ||
q10_rh 1.76 | ||
diff 2.4 | ||
|
||
Objective Function Value: 2.32 | ||
|
||
CO2 MSE: 4.57 | ||
T MSE: 0.0772 | ||
RMSE: 2.14 | ||
|
||
***Key Metrics*** | ||
TCRE: 1.51 | ||
TCR: 1.76 | ||
|
||
***Historical Warming and ERF*** | ||
GSAT Warming: 0.73 | ||
Ocean Heat Content Change: 472 | ||
Total Aerosol ERF: -1.24 | ||
WMGHG ERF: 3.87 | ||
Methane ERF: 0.54 | ||
|
||
***Future Warming*** | ||
scenario start end GSAT | ||
ssp119 2021 2040 0.729 | ||
ssp119 2041 2060 0.894 | ||
ssp119 2081 2100 0.717 | ||
ssp126 2021 2040 0.744 | ||
ssp126 2041 2060 1.08 | ||
ssp126 2081 2100 1.1 | ||
ssp245 2021 2040 0.749 | ||
ssp245 2041 2060 1.29 | ||
ssp245 2081 2100 1.98 | ||
ssp370 2021 2040 0.76 | ||
ssp370 2041 2060 1.43 | ||
ssp370 2081 2100 2.93 | ||
ssp585 2021 2040 0.876 | ||
ssp585 2041 2060 1.74 | ||
ssp585 2081 2100 3.79 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
parameters values | ||
beta 0.528263352380768 | ||
q10_rh 1.76 | ||
diff 2.4 | ||
|
||
Objective Function Value: 2.32 | ||
|
||
CO2 MSE: 4.57 | ||
T MSE: 0.0772 | ||
RMSE: 2.14 | ||
|
||
***Key Metrics*** | ||
TCRE: 1.51 | ||
TCR: 1.76 | ||
|
||
***Historical Warming and ERF*** | ||
GSAT Warming: 0.73 | ||
Ocean Heat Content Change: 472 | ||
Total Aerosol ERF: -1.24 | ||
WMGHG ERF: 3.87 | ||
Methane ERF: 0.54 | ||
|
||
***Future Warming*** | ||
scenario start end GSAT | ||
ssp119 2021 2040 0.729 | ||
ssp119 2041 2060 0.894 | ||
ssp119 2081 2100 0.717 | ||
ssp126 2021 2040 0.744 | ||
ssp126 2041 2060 1.08 | ||
ssp126 2081 2100 1.1 | ||
ssp245 2021 2040 0.749 | ||
ssp245 2041 2060 1.29 | ||
ssp245 2081 2100 1.98 | ||
ssp370 2021 2040 0.76 | ||
ssp370 2041 2060 1.43 | ||
ssp370 2081 2100 2.93 | ||
ssp585 2021 2040 0.876 | ||
ssp585 2041 2060 1.74 | ||
ssp585 2081 2100 3.79 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Script to make smoothed temperature comparison plot | ||
# Author: Peter Scully | ||
# Date: 6/17/24 | ||
|
||
# Importing libraries | ||
library(hector) | ||
library(zoo) | ||
library(ggplot2) | ||
|
||
# Setting up file paths | ||
COMP_DATA_DIR <- file.path(here::here(), "comparison_data") | ||
SCRIPTS_DIR <- file.path(here::here(), "scripts") | ||
RESULTS_DIR <- file.path(here::here(), "results") | ||
|
||
CO2_PATH <- file.path(COMP_DATA_DIR, | ||
"Supplementary_Table_UoM_GHGConcentrations-1-1-0_annualmeans_v23March2017.csv") | ||
TEMP_PATH <- | ||
file.path(COMP_DATA_DIR, | ||
"HadCRUT.5.0.2.0.analysis.summary_series.global.annual.csv") | ||
|
||
INI_FILE <- system.file("input/hector_ssp245.ini", package = "hector") | ||
|
||
# Setting other constants | ||
PARAMS <- c(BETA(), Q10_RH(), DIFFUSIVITY()) | ||
BEST_PARS <- c(0.528263386504877, 1.76, 2.4) # from 3 year results | ||
|
||
OUTPUT <- file.path(RESULTS_DIR, "graph_smooth_temps.jpeg") | ||
|
||
|
||
|
||
source(file.path(SCRIPTS_DIR, "major_functions.R")) | ||
|
||
### Getting observational data ### | ||
temp_data <- get_temp_data(TEMP_PATH) | ||
|
||
obs_data <- temp_data | ||
|
||
# Getting smoothed temperatures | ||
for (k in c(3, 10)) { | ||
smoothed_temps <- rollmean(temp_data$value, | ||
k = k, | ||
align = "center", | ||
fill = NA) | ||
smoothed_temp_data <- temp_data | ||
smoothed_temp_data$value <- smoothed_temps | ||
smoothed_temp_data$scenario <- paste("Smoothed, k =", k) | ||
obs_data <- rbind(obs_data, smoothed_temp_data) | ||
} | ||
|
||
### Getting Hector data ### | ||
hector_data <- run_hector(ini_file = INI_FILE, | ||
params = PARAMS, | ||
vals = BEST_PARS, | ||
yrs = 1850:2014, | ||
vars = GMST()) | ||
hector_data$scenario <- "Fit to Smoothed (and unsmoothed) Data" | ||
|
||
### Plotting data ### | ||
comb_data <- rbind(obs_data, hector_data) | ||
ggplot(data = comb_data) + | ||
geom_line(aes(x = year, y = value, color = scenario)) | ||
ggsave(OUTPUT, width = 9) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.