import xarray as xr
import xarray.ufuncs as xrf
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import glob
from matplotlib import colors
from definitions import * # imports all functions from definitions.py
xr.set_options(
keep_attrs=True, display_style="html"
) # Attributes of DataArrays will be kept through operations.
plt.rcParams["font.size"] = "22"
alt = [
70,
72,
74,
76,
78,
80,
82,
84,
86,
88,
90,
92,
94,
96,
98,
100,
102,
104,
106,
108,
110,
112,
114,
116,
118,
120,
]
root_path = "/home/gemeinsam_tmp/UA_students/data/PW_GW_analysis/"
dir_path = "/home/hochatmstud/bene/"
station = "Leipzig"
# Parameters
station = "Andenes"
ds_wind = read_group("wind", station)
u = read_var(ds_wind, "u0")
v = read_var(ds_wind, "v0")
u_anomalie = anomalie("day", u)
v_anomalie = anomalie("day", v)
sea_u = sea(40, station, u)
sea_u_anomalie = sea(40, station, u_anomalie)
sea_v = sea(40, station, v)
sea_v_anomalie = sea(40, station, v_anomalie)
/home/hochatmstud/.conda/envs/uas/lib/python3.6/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice return np.nanmean(a, axis=axis, dtype=dtype) /home/hochatmstud/.conda/envs/uas/lib/python3.6/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice return np.nanmean(a, axis=axis, dtype=dtype) /home/hochatmstud/.conda/envs/uas/lib/python3.6/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice return np.nanmean(a, axis=axis, dtype=dtype)
plotting_routine(sea_u, "u0")
plotting_routine(sea_u_anomalie, "u0")
plotting_routine(sea_v, "v0")
plotting_routine(sea_v_anomalie, "v0")
ds_waves = read_group("waves", station)
gw = read_var(ds_waves, "GW")
pw = read_var(ds_waves, "PW")
gw_anomalie = anomalie("day", gw)
pw_anomalie = anomalie("day", pw)
sea_gw = sea(40, station, gw)
sea_gw["name"] = "sea_gw"
sea_gw_anomalie = sea(40, station, gw_anomalie)
sea_gw_anomalie["name"] = "sea_gw_anomalie"
sea_pw = sea(40, station, pw)
sea_pw["name"] = "sea_pw"
sea_pw_anomalie = sea(40, station, pw_anomalie)
sea_pw_anomalie["name"] = "sea_pw_anomalie"
/home/hochatmstud/.conda/envs/uas/lib/python3.6/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice return np.nanmean(a, axis=axis, dtype=dtype) /home/hochatmstud/.conda/envs/uas/lib/python3.6/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice return np.nanmean(a, axis=axis, dtype=dtype) /home/hochatmstud/.conda/envs/uas/lib/python3.6/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice return np.nanmean(a, axis=axis, dtype=dtype)
plotting_routine(sea_gw, "GW")
plotting_routine(sea_gw_anomalie, "GW")
plotting_routine(sea_pw, "PW")
plotting_routine(sea_pw_anomalie, "PW")