Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -214,29 +214,37 @@ with c2:
|
|
| 214 |
</div>
|
| 215 |
""", unsafe_allow_html=True)
|
| 216 |
|
| 217 |
-
# 2. Charts
|
|
|
|
| 218 |
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
|
| 224 |
fig1 = go.Figure()
|
| 225 |
|
|
|
|
| 226 |
fig1.add_trace(go.Scatter(
|
| 227 |
x=years, y=emissions_hist,
|
| 228 |
mode='lines+markers',
|
| 229 |
-
name='Historical
|
| 230 |
line=dict(color='gray', width=2)
|
| 231 |
))
|
| 232 |
|
|
|
|
| 233 |
fig1.add_trace(go.Scatter(
|
| 234 |
-
x=[
|
| 235 |
-
mode='
|
| 236 |
name='2030 Climate Goal (50% Cut)',
|
| 237 |
-
|
| 238 |
))
|
| 239 |
|
|
|
|
| 240 |
fig1.add_trace(go.Bar(
|
| 241 |
x=[2030], y=[bau_2030],
|
| 242 |
name='2030 Baseline Estimate',
|
|
@@ -251,16 +259,16 @@ fig1.add_trace(go.Bar(
|
|
| 251 |
|
| 252 |
fig1.update_layout(
|
| 253 |
height=650,
|
| 254 |
-
font=dict(size=18),
|
| 255 |
title={
|
| 256 |
-
'text': "
|
| 257 |
-
'font': {'size':
|
| 258 |
'x': 0.5,
|
| 259 |
'xanchor': 'center'
|
| 260 |
},
|
| 261 |
yaxis={
|
| 262 |
'title': {
|
| 263 |
-
'text': "Emissions (Million tCO<sub>2</sub>
|
| 264 |
'font': {'size': 20}
|
| 265 |
},
|
| 266 |
'tickfont': {'size': 16}
|
|
@@ -286,8 +294,9 @@ st.markdown("---")
|
|
| 286 |
with st.expander("📚 Data Sources & Methodology"):
|
| 287 |
st.markdown(f"""
|
| 288 |
**Methodology Updates:**
|
| 289 |
-
* **
|
|
|
|
| 290 |
* **Efficiency Logic:** Emissions Factor is calculated dynamically based on the **Electrical Efficiency** slider ({turbine_eff_percent}% currently selected).
|
| 291 |
* *Formula:* `EF = (Benchmark Carbon Content) / Efficiency %`
|
| 292 |
-
*
|
| 293 |
""")
|
|
|
|
| 214 |
</div>
|
| 215 |
""", unsafe_allow_html=True)
|
| 216 |
|
| 217 |
+
# 2. Charts
|
| 218 |
+
st.subheader("US Emissions Trajectory vs. AI Impact")
|
| 219 |
|
| 220 |
+
# Updated Data from Our World in Data (Billion tCO2e -> Million tCO2e)
|
| 221 |
+
years = [2020, 2021, 2022, 2023, 2024]
|
| 222 |
+
emissions_hist = [4690, 5020, 5060, 4920, 4900]
|
| 223 |
+
|
| 224 |
+
# Target: 50% reduction from 2005 levels (approx 6130 MMT CO2 in 2005 -> ~3065 MMT target)
|
| 225 |
+
# Adjusted to match the specific CO2-only metric provided
|
| 226 |
+
target_2030 = 3065
|
| 227 |
+
bau_2030 = 4800 # Optimistic business-as-usual decline for CO2 only
|
| 228 |
|
| 229 |
fig1 = go.Figure()
|
| 230 |
|
| 231 |
+
# History Line
|
| 232 |
fig1.add_trace(go.Scatter(
|
| 233 |
x=years, y=emissions_hist,
|
| 234 |
mode='lines+markers',
|
| 235 |
+
name='Historical CO₂ (Fossil/Industry)',
|
| 236 |
line=dict(color='gray', width=2)
|
| 237 |
))
|
| 238 |
|
| 239 |
+
# Target Dot (Changed from line to single marker)
|
| 240 |
fig1.add_trace(go.Scatter(
|
| 241 |
+
x=[2030], y=[target_2030],
|
| 242 |
+
mode='markers',
|
| 243 |
name='2030 Climate Goal (50% Cut)',
|
| 244 |
+
marker=dict(color='green', size=12, symbol='circle')
|
| 245 |
))
|
| 246 |
|
| 247 |
+
# AI Impact Stacked Bar
|
| 248 |
fig1.add_trace(go.Bar(
|
| 249 |
x=[2030], y=[bau_2030],
|
| 250 |
name='2030 Baseline Estimate',
|
|
|
|
| 259 |
|
| 260 |
fig1.update_layout(
|
| 261 |
height=650,
|
| 262 |
+
font=dict(size=18),
|
| 263 |
title={
|
| 264 |
+
'text': "Can we hit the 50% reduction target?",
|
| 265 |
+
'font': {'size': 24},
|
| 266 |
'x': 0.5,
|
| 267 |
'xanchor': 'center'
|
| 268 |
},
|
| 269 |
yaxis={
|
| 270 |
'title': {
|
| 271 |
+
'text': "Emissions (Million tCO<sub>2</sub>)",
|
| 272 |
'font': {'size': 20}
|
| 273 |
},
|
| 274 |
'tickfont': {'size': 16}
|
|
|
|
| 294 |
with st.expander("📚 Data Sources & Methodology"):
|
| 295 |
st.markdown(f"""
|
| 296 |
**Methodology Updates:**
|
| 297 |
+
* **Historical Data:** US Annual CO₂ emissions from fossil fuels and industry (2020-2024). Land-use change emissions are not included. [Source: Our World in Data](https://ourworldindata.org/profile/co2/united-states).
|
| 298 |
+
* **Baseline Emissions:** Compared against approx. {US_BASELINE_MMT} MMT (EPA Gross GHG Inventory).
|
| 299 |
* **Efficiency Logic:** Emissions Factor is calculated dynamically based on the **Electrical Efficiency** slider ({turbine_eff_percent}% currently selected).
|
| 300 |
* *Formula:* `EF = (Benchmark Carbon Content) / Efficiency %`
|
| 301 |
+
* Based on standard [NREL](https://docs.nrel.gov/docs/fy21osti/80580.pdf) life cycle emissions data for Combined Cycle Gas Turbines (486 gCO₂e/kWh @ 60% efficiency).
|
| 302 |
""")
|