forked from framework-CPTEC/CPTEC-user
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_figure.py
More file actions
46 lines (33 loc) · 1.35 KB
/
Copy pathplot_figure.py
File metadata and controls
46 lines (33 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Importa a ferramenta
import cptecmodel.CPTEC_ETA as ETA
import matplotlib.pyplot as plt
# Inicializa o construtor
eta = ETA.model()
# Data condição inicial (IC)
date = '2022121800'
# variaveis
vars = ['u10m']
# Quantos passos previstos após inicialização do modelo
steps = 5
# O resultado da requisição dos dados são armazenados na variavel f
f = eta.load(date=date, var=vars, steps=steps)
# Para verificar as datas disponiveis, latitudes, longitudes e niveis quando presente use o exemplo abaixo
print('Horarios disponiveis:', f.time.values, '\n')
print('Latitude :', f.latitude.values, '\n')
print('Longitude:', f.longitude.values, '\n')
# print('Level:', f.level)
# Plot simples para verificação dos campos
# selecionando apenas por tempo
fig, axes = plt.subplots(nrows=1, ncols=1, figsize=(7, 7))
f.sel(time='20221118T01:00').u10m.plot.pcolormesh(
ax=axes, robust=True, add_colorbar=True, add_labels=True)
axes.set_title('Eta 2022-11-18T01:00 U10M', ha='center')
plt.show()
# Plot simples dando zoom em area
# selecionando apenas por tempo
fig, axes = plt.subplots(nrows=1, ncols=1, figsize=(7, 7))
f.sel(time='20221118T01:00', latitude=slice(-30,5), longitude=slice(280, 300)).u10m.plot.pcolormesh(
ax=axes, robust=True, add_colorbar=True, add_labels=True)
axes.set_title('Eta 2022-11-18T01:00 U10M', ha='center')
plt.show()
quit()