Skip to content

Commit

Permalink
Merge pull request #248 from Bonface-Osoro/revise_graphics
Browse files Browse the repository at this point in the history
Revise graphics
  • Loading branch information
edwardoughton committed Mar 7, 2024
2 parents 884541d + f638d44 commit 9301cb9
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 92 deletions.
98 changes: 49 additions & 49 deletions data/processed/interim_results_capacity.csv

Large diffs are not rendered by default.

Binary file modified data/raw/life_cycle_data.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion scripts/run.py
Expand Up @@ -726,7 +726,7 @@ def calc_total_emissions():
'total_human_toxicity' : 'total_human_toxicity_cases'}

df1.rename(columns = renamed_columns, inplace = True)

filename2 = 'total_emissions.csv'
path_out2 = os.path.join(BASE_PATH, '..', 'results', filename2)
df1.to_csv(path_out2, index = False)
Expand Down
Binary file modified validation/Total rocket emissions.xlsx
Binary file not shown.
Binary file modified validation/percentage_calculations.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion vis/aggregate_metrics.r
Expand Up @@ -50,7 +50,7 @@ df$rocket_type = factor(

totals <- df %>%
group_by(combined) %>%
summarize(value = signif(sum(no_launches), 2))
summarize(value = sum(no_launches))

sat_launches =
ggplot(df, aes(x = combined, y = no_launches)) +
Expand Down
8 changes: 4 additions & 4 deletions vis/capacity.r
Expand Up @@ -183,16 +183,16 @@ df$CNR = factor(
const_capacity <-
ggplot(df, aes(
x = constellation,
y = (mean) * 0.65 / 1e6,
y = (mean_gbps),
fill = CNR
)) +
geom_bar(stat = "identity",
position = position_dodge(),
width = 0.98) +
geom_errorbar(
aes(
ymin = mean * 0.65 / 1e6 - sd * 0.65 / 1e6,
ymax = mean * 0.65 / 1e6 + sd * 0.65 / 1e6
ymin = mean_gbps - sd_gbps,
ymax = mean_gbps + sd_gbps
),
width = .2,
position = position_dodge(.98),
Expand All @@ -212,7 +212,7 @@ const_capacity <-
labels = function(y)
format(y, scientific = FALSE),
expand = c(0, 0),
limits = c(0, 45)
limits = c(0, 53)
) +
theme_minimal() +
theme(
Expand Down
50 changes: 29 additions & 21 deletions vis/cost.R
Expand Up @@ -29,19 +29,22 @@ data <- select(
##Constellation Capex##
#######################

df = data %>%
df_capex = data %>%
group_by(constellation) %>%
summarize(mean = mean(capex_costs),
sd = sd(capex_costs))
sd = sd(capex_costs),
mean_bn = round(mean(capex_costs)/1e9,2),
sd_bn = round(sd(capex_costs)/1e9,2)
)

df$constellation = factor(
df$constellation,
df_capex$constellation = factor(
df_capex$constellation,
levels = c('Kuiper', 'OneWeb', 'Starlink', 'GEO'),
labels = c('Kuiper', 'OneWeb', 'Starlink', 'GEO')
)

constellation_capex <-
ggplot(df, aes(x = constellation, y = mean / 1e6)) +
ggplot(df_capex, aes(x = constellation, y = mean / 1e6)) +
geom_bar(stat = "identity",
position = position_dodge(),
width = 0.9) +
Expand All @@ -66,7 +69,7 @@ constellation_capex <-
scale_y_continuous(
labels = function(y)
format(y, scientific = FALSE),
limits = c(0, 4599),
limits = c(0, 7800),
expand = c(0, 0)
) + theme_minimal() +
theme(
Expand All @@ -92,19 +95,22 @@ constellation_capex <-
##Constellation Total operating Costs##
#######################################

df = data %>%
df_opex = data %>%
group_by(constellation) %>%
summarize(mean = mean(opex_costs),
sd = sd(opex_costs))
sd = sd(opex_costs),
mean_bn = round(mean(opex_costs)/1e9,2),
sd_bn = round(sd(opex_costs)/1e9,2)
)

df$constellation = factor(
df$constellation,
df_opex$constellation = factor(
df_opex$constellation,
levels = c('Kuiper', 'OneWeb', 'Starlink', 'GEO'),
labels = c('Kuiper', 'OneWeb', 'Starlink', 'GEO')
)

constellation_opex <-
ggplot(df, aes(x = constellation, y = mean / 1e6)) +
ggplot(df_opex, aes(x = constellation, y = mean / 1e6)) +
geom_bar(stat = "identity",
position = position_dodge(),
width = 0.9) +
Expand All @@ -128,7 +134,7 @@ constellation_opex <-
scale_y_continuous(
labels = function(y)
format(y, scientific = FALSE),
limits = c(0, 4599),
limits = c(0, 7800),
expand = c(0, 0)
) + theme_minimal() +
theme(
Expand All @@ -154,20 +160,22 @@ constellation_opex <-
##Annualized Constellation Total Cost of Ownership##
####################################################


df = data %>%
df_tco = data %>%
group_by(constellation) %>%
summarize(mean = mean(total_cost_ownership / assessment_period_year),
sd = sd(total_cost_ownership / assessment_period_year))
summarize(mean = mean(total_cost_ownership),
sd = sd(total_cost_ownership),
mean_bn = round(mean(total_cost_ownership)/1e9,2),
sd_bn = round(sd(total_cost_ownership)/1e9,2)
)

df$constellation = factor(
df$constellation,
df_tco$constellation = factor(
df_tco$constellation,
levels = c('Kuiper', 'OneWeb', 'Starlink', 'GEO'),
labels = c('Kuiper', 'OneWeb', 'Starlink', 'GEO')
)

constellation_tco <-
ggplot(df, aes(x = constellation, y = mean / 1e6)) +
ggplot(df_tco, aes(x = constellation, y = mean / 1e6)) +
geom_bar(stat = "identity",
position = position_dodge(),
width = 0.9) +
Expand All @@ -186,13 +194,13 @@ constellation_tco <-
title = " ",
subtitle = NULL,
x = NULL,
y = "Annualized TCO\n(US$ Millions)",
y = "TCO\n(US$ Millions)",
fill = 'Cost\nScenario'
) +
scale_y_continuous(
labels = function(y)
format(y, scientific = FALSE),
expand = c(0, 0), limits = c(0, 4599)
expand = c(0, 0), limits = c(0, 7800)
) + theme_minimal() +
theme(
strip.text.x = element_blank(),
Expand Down
19 changes: 14 additions & 5 deletions vis/emissions.R
Expand Up @@ -74,8 +74,12 @@ df = data %>%

check_sums = df %>%
group_by(constellation) %>%
summarize(annual_baseline_emission_Mt = round(
sum(cc_baseline)/1e9,1))
summarize(
annual_baseline_emission_kg = round(sum(cc_baseline)/5,2),
baseline_emission_kg = round(sum(cc_baseline),1),
annual_baseline_emission_Mt = round(sum(cc_baseline)/5/1e9,2),
baseline_emission_Mt = round(sum(cc_baseline)/1e9,1)
)

totals <- df %>%
group_by(constellation, rocket_type) %>%
Expand Down Expand Up @@ -136,9 +140,14 @@ check_sums = df1 %>%
summarize(cc_worst_case_Mt = round(
sum(cc_worst_case)/1e9,1))

totals <- df1 %>%
group_by(constellation, rocket_type) %>%
summarize(value = signif(sum(cc_worst_case)))
check_sums = df1 %>%
group_by(constellation) %>%
summarize(
annual_baseline_emission_kg = round(sum(cc_worst_case)/5,2),
baseline_emission_kg = round(sum(cc_worst_case),1),
annual_baseline_emission_Mt = round(sum(cc_worst_case)/5/1e9,2),
baseline_emission_Mt = round(sum(cc_worst_case)/1e9,1)
)

climate_change_wc <-
ggplot(df1, aes(x = constellation, y = cc_worst_case / 1e9)) +
Expand Down
Binary file modified vis/figures/c_aggregate_metrics.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vis/figures/g_capacity_metrics.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vis/figures/z_meta_figures_file.pptx
Binary file not shown.
22 changes: 11 additions & 11 deletions vis/rocket_scenario_plots.R
Expand Up @@ -87,7 +87,7 @@ emission_subscriber <-
legend.position = 'none',
axis.text.x = element_text(size = 9),
panel.spacing = unit(0.6, "lines"),
plot.title = element_text(size = 12, face = "bold"),
plot.title = element_text(size = 8, face = "bold"),
plot.subtitle = element_text(size = 10),
axis.text.y = element_text(size = 9),
axis.title.y = element_markdown(size = 9),
Expand Down Expand Up @@ -167,7 +167,7 @@ df = data %>%
check_sums = df %>%
group_by(constellation, scenario) %>%
summarize(cc_baseline_sum = round(
sum(cc_baseline)/ 1e9,3))
sum(cc_baseline)/ 1e9,2))

df$scenario = factor(
df$scenario,
Expand All @@ -188,7 +188,7 @@ climate_change <-
aes(
x = constellation,
y = value / 1e9,
label = round(value / 1e9, 3)
label = round(value / 1e9, 2)
),
size = 2.5,
data = totals,
Expand All @@ -213,7 +213,7 @@ climate_change <-
legend.position = 'none',
axis.text.x = element_text(size = 9),
panel.spacing = unit(0.6, "lines"),
plot.title = element_text(size = 12, face = "bold"),
plot.title = element_text(size = 8, face = "bold"),
plot.subtitle = element_text(size = 6),
axis.text.y = element_text(size = 9),
axis.title.y = element_markdown(size = 9),
Expand Down Expand Up @@ -256,7 +256,7 @@ climate_change_wc <-
aes(
x = constellation,
y = value / 1e9,
label = round(value / 1e9, 1)
label = round(value / 1e9, 2)
),
size = 2.5,
data = totals,
Expand All @@ -281,7 +281,7 @@ climate_change_wc <-
legend.position = 'none',
axis.text.x = element_text(size = 9),
panel.spacing = unit(0.6, "lines"),
plot.title = element_text(size = 12, face = "bold"),
plot.title = element_text(size = 8, face = "bold"),
plot.subtitle = element_text(size = 6),
axis.text.y = element_text(size = 9),
axis.title.y = element_markdown(size = 9),
Expand Down Expand Up @@ -350,7 +350,7 @@ ozone_depletion <-
legend.position = 'none',
axis.text.x = element_text(size = 9),
panel.spacing = unit(0.6, "lines"),
plot.title = element_text(size = 12, face = "bold"),
plot.title = element_text(size = 8, face = "bold"),
plot.subtitle = element_text(size = 6),
axis.text.y = element_text(size = 9),
axis.title.y = element_markdown(size = 9),
Expand Down Expand Up @@ -418,7 +418,7 @@ ozone_depletion_wc <-
legend.position = 'none',
axis.text.x = element_text(size = 9),
panel.spacing = unit(0.6, "lines"),
plot.title = element_text(size = 12, face = "bold"),
plot.title = element_text(size = 8, face = "bold"),
plot.subtitle = element_text(size = 6),
axis.text.y = element_text(size = 9),
axis.title.y = element_markdown(size = 9),
Expand Down Expand Up @@ -484,7 +484,7 @@ resource_depletion <-
legend.position = 'none',
axis.text.x = element_text(size = 9),
panel.spacing = unit(0.6, "lines"),
plot.title = element_text(size = 12, face = "bold"),
plot.title = element_text(size = 8, face = "bold"),
plot.subtitle = element_text(size = 6),
axis.text.y = element_text(size = 9),
axis.title.y = element_markdown(size = 12),
Expand Down Expand Up @@ -551,7 +551,7 @@ freshwater_ecotixicity <-
legend.position = 'none',
axis.text.x = element_text(size = 9),
panel.spacing = unit(0.6, "lines"),
plot.title = element_text(size = 12, face = "bold"),
plot.title = element_text(size = 8, face = "bold"),
plot.subtitle = element_text(size = 6),
axis.text.y = element_text(size = 9),
axis.title.y = element_markdown(size = 12),
Expand Down Expand Up @@ -618,7 +618,7 @@ human_toxicity <-
legend.position = 'none',
axis.text.x = element_text(size = 9),
panel.spacing = unit(0.6, "lines"),
plot.title = element_text(size = 12, face = "bold"),
plot.title = element_text(size = 8, face = "bold"),
plot.subtitle = element_text(size = 6),
axis.text.y = element_text(size = 9),
axis.title.y = element_markdown(size = 12),
Expand Down

0 comments on commit 9301cb9

Please sign in to comment.