← LAMPIRAN MENULAMPIRAN 13 / 18
S1D4NG.5KR1P51.404 · ANNEX FILE
Lampiran 13. Program python Tekanan dan Suhu permukaan 23-25 Maret 2025 di Kabupaten Kudus
//⚠ S1D4NG.5KR1P51.404 — BIOHAZARD ZONE·//⚠ NO SHARP · NO NARCOTICS · NO WEIRD CARGO·//⚠ THE HUM IS LOUDER WHEN YOU NOTICE IT·//⚠ ERROR 404 RECOVERED — STILL WRONG·//⚠ LEVEL 0 · DO NOT TRUST THE CORRIDOR·
Lampiran 13. Program python Tekanan dan Suhu permukaan 23-25 Maret 2025 di Kabupaten Kudus
| import xarray as xr import pandas as pd import matplotlib.pyplot as plt import matplotlib.ticker as mticker import matplotlib.dates as mdates import math plt.rcParams['font.family'] = 'Arial' plt.rcParams['font.size'] = 11 plt.rcParams['axes.linewidth'] = 0.8 ds = xr.open_dataset(r'~\Skripsi\precipitation_analysis\era5_kudus_surface_21_25mar2025.grib', engine='cfgrib') df = pd.DataFrame({ 'time': pd.to_datetime(ds.time.values), 'sp': ds.sp.values.flatten() / 100, 't2m': ds.t2m.values.flatten() - 273.15, }) df['time_wib'] = df['time'] + pd.Timedelta(hours=7) flood_time = pd.Timestamp('2025-03-24 22:45:00') day_bds = [pd.Timestamp(f'2025-03-{d} 00:00:00') for d in range(22, 26)] fig, ax = plt.subplots(figsize=(14, 5)) ax.plot(df['time_wib'], df['sp'], color='#1a1a2e', linewidth=1.4, zorder=3) ax.fill_between(df['time_wib'], df['sp'], alpha=0.10, color='#1a1a2e', zorder=2) ax.axvline(x=flood_time, color='#d62828', linewidth=1.2, linestyle='--', alpha=0.7, zorder=4) for bd in day_bds: ax.axvline(x=bd, color='#adb5bd', linewidth=0.6, linestyle=':', alpha=0.5, zorder=1) ax.set_ylabel('Tekanan Udara Permukaan (hPa)', fontsize=11, fontweight='bold') ax.set_xlabel('Waktu (WIB)', fontsize=11, fontweight='bold') ax.yaxis.set_major_locator(mticker.MultipleLocator(2)) ax.yaxis.set_minor_locator(mticker.MultipleLocator(1)) ax.set_xlim(df['time_wib'].iloc[0], df['time_wib'].iloc[-1]) ax.xaxis.set_major_locator(mdates.HourLocator(interval=12)) ax.xaxis.set_minor_locator(mdates.HourLocator(interval=3)) ax.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M\n%d/%m')) plt.setp(ax.xaxis.get_majorticklabels(), fontsize=8) ax.grid(True, axis='y', which='major', linestyle='--', linewidth=0.4, alpha=0.3) ax.grid(True, axis='x', which='major', linestyle='--', linewidth=0.3, alpha=0.15) ax.grid(True, axis='y', which='minor', linestyle=':', linewidth=0.3, alpha=0.15) ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) fig.text(0.5, -0.03, 'Sumber: ERA5 Reanalysis (ECMWF) | Waktu dalam WIB (UTC+7)\nKoordinat: 110.8\u00b0E, 6.75\u00b0S', ha='center', fontsize=7.5, color='#868e96', style='italic') plt.tight_layout(rect=[0, 0.06, 1, 1]) out1 = r'G:\SKRIPSI\Nova\SkripsiRev\precipitation_analysis\tekanan_udara_21_25mar2025.png' plt.savefig(out1, dpi=300, bbox_inches='tight', facecolor='white') plt.close() print(f'Gambar 6: {out1}') fig, ax = plt.subplots(figsize=(14, 5)) ax.plot(df['time_wib'], df['t2m'], color='#e85d04', linewidth=1.4, zorder=3) ax.fill_between(df['time_wib'], df['t2m'], alpha=0.10, color='#e85d04', zorder=2) ax.axvline(x=flood_time, color='#d62828', linewidth=1.2, linestyle='--', alpha=0.7, zorder=4) for bd in day_bds: ax.axvline(x=bd, color='#adb5bd', linewidth=0.6, linestyle=':', alpha=0.5, zorder=1) ax.set_ylabel('Suhu Permukaan (\u00b0C)', fontsize=11, fontweight='bold') ax.set_xlabel('Waktu (WIB)', fontsize=11, fontweight='bold') ax.yaxis.set_major_locator(mticker.MultipleLocator(2)) ax.yaxis.set_minor_locator(mticker.MultipleLocator(1)) ax.set_xlim(df['time_wib'].iloc[0], df['time_wib'].iloc[-1]) ax.xaxis.set_major_locator(mdates.HourLocator(interval=12)) ax.xaxis.set_minor_locator(mdates.HourLocator(interval=3)) ax.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M\n%d/%m')) plt.setp(ax.xaxis.get_majorticklabels(), fontsize=8) ax.grid(True, axis='y', which='major', linestyle='--', linewidth=0.4, alpha=0.3) ax.grid(True, axis='x', which='major', linestyle='--', linewidth=0.3, alpha=0.15) ax.grid(True, axis='y', which='minor', linestyle=':', linewidth=0.3, alpha=0.15) ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) fig.text(0.5, -0.03, 'Sumber: ERA5 Reanalysis (ECMWF) | Waktu dalam WIB (UTC+7)\nKoordinat: 110.8\u00b0E, 6.75\u00b0S', ha='center', fontsize=7.5, color='#868e96', style='italic') plt.tight_layout(rect=[0, 0.06, 1, 1]) out2 = r'~\Skripsi\precipitation_analysis\suhu_permukaan_23_25mar2025.png' plt.savefig(out2, dpi=300, bbox_inches='tight', facecolor='white') plt.close() print(f'Gambar 7: {out2}') print('\n=== DEKLINASI MATAHARI ===') for day in [21, 22, 23, 24, 25]: n = 80 + day delta = 23.45 * math.sin(math.radians(360/365 * (284 + n))) print(f'{day} Mar 2025: {delta:.2f}\u00b0') |