Loading...
Vietnam Geography App
Loading...
Vietnam Geography App
Tìm hiểu các nguyên lý cơ bản của hệ thống khí hậu Trái Đất và biến đổi khí hậu.
Sử dụng Python để phân tích xu hướng nhiệt độ từ dataset NASA GISS
Phát hiện xu hướng tăng nhiệt độ toàn cầu ~1.1°C từ thời kỳ tiền công nghiệp
# Climate Data Analysis
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
# Load NASA GISS temperature data
url = "https://data.giss.nasa.gov/gistemp/tabledata_v4/GLB.Ts+dSST.csv"
df = pd.read_csv(url, skiprows=1)
# Clean and prepare data
df = df[df["Year"] >= 1880] # Reliable data from 1880
df["AnnualMean"] = df[["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]].mean(axis=1)
# Calculate temperature anomalies (base: 1951-1980)
base_period = df[(df["Year"] >= 1951) & (df["Year"] <= 1980)]
baseline = base_period["AnnualMean"].mean()
df["Anomaly"] = df["AnnualMean"] - baseline
# Linear regression for trend
slope, intercept, r_value, p_value, std_err = stats.linregress(df["Year"], df["Anomaly"])
print(f"Warming rate: {slope:.3f}°C per decade")
print(f"R-squared: {r_value**2:.3f}")
# Plotting
fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(12, 10))
# Temperature anomaly trend
ax1.plot(df["Year"], df["Anomaly"], alpha=0.7, color="blue", label="Annual")
ax1.plot(df["Year"], slope * df["Year"] + intercept, "r-", label=f"Trend: {slope:.3f}°C/decade")
ax1.axhline(y=0, color="black", linestyle="--", alpha=0.5)
ax1.set_ylabel("Temperature Anomaly (°C)")
ax1.set_title("Global Temperature Anomalies (1880-2023)")
ax1.legend()
ax1.grid(True, alpha=0.3)
# Recent decades comparison
recent_30yr = df[df["Year"] >= 1994]["Anomaly"].mean()
early_30yr = df[(df["Year"] >= 1880) & (df["Year"] <= 1909)]["Anomaly"].mean()
difference = recent_30yr - early_30yr
ax2.bar(["1880-1909", "1994-2023"], [early_30yr, recent_30yr],
color=["lightblue", "red"], alpha=0.7)
ax2.set_ylabel("Average Temperature Anomaly (°C)")
ax2.set_title(f"30-Year Average Comparison\nDifference: {difference:.2f}°C")
ax2.axhline(y=0, color="black", linestyle="--", alpha=0.5)
plt.tight_layout()
plt.show()
# Key statistics
print(f"\nKey Climate Statistics:")
print(f"Temperature increase since 1880: {df.iloc[-1]["Anomaly"] - df.iloc[0]["Anomaly"]:.2f}°C")
print(f"Warmest year on record: {df.loc[df["Anomaly"].idxmax(), "Year"]} ({df["Anomaly"].max():.2f}°C)")
print(f"Number of years above 1°C warming: {len(df[df["Anomaly"] > 1.0])}")Intergovernmental Panel on Climate Change
Synthesize global climate science for policymakers
Comprehensive assessment của climate data và projections
Fundamental basis cho Paris Agreement và climate policy