|
|
import matplotlib.pyplot as plt |
|
|
import numpy as np |
|
|
|
|
|
from plots import plot_map_rain, project_to_latlon |
|
|
|
|
|
|
|
|
data = np.load("2020/202004201700.npz") |
|
|
rain = data["arr_0"] |
|
|
print("Array shape:", rain.shape) |
|
|
|
|
|
|
|
|
rain = np.where(rain < 0, np.nan, rain) |
|
|
|
|
|
|
|
|
print("Making basic plot...") |
|
|
plt.imshow(rain, cmap="Blues") |
|
|
plt.colorbar(label="Rainfall (x0.01 mm / 5min)") |
|
|
plt.title("Rainfall Accumulation – 2020-04-20 17:00 UTC") |
|
|
plt.savefig("rainfall_20200420_1700_basic.png") |
|
|
plt.close() |
|
|
|
|
|
print("Converting and projecting rainfall data...") |
|
|
rain = rain / 100 |
|
|
rain = rain * 60 / 5 |
|
|
da_reproj = project_to_latlon(rain) |
|
|
print(da_reproj) |
|
|
|
|
|
print("Plotting projected rainfall data...") |
|
|
plot_map_rain( |
|
|
data=da_reproj, |
|
|
title="Rainfall Rate – 2020-04-20 17:00 UTC", |
|
|
path="rainfall_20200420_1700_map.png", |
|
|
) |
|
|
|