Skip to content

Commit

Permalink
update wind_wave_dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
efekhari27 committed Apr 1, 2023
1 parent 30c1fdf commit 07271ad
Show file tree
Hide file tree
Showing 7 changed files with 9,998 additions and 1,005 deletions.
10,986 changes: 9,993 additions & 993 deletions examples/data/wind_waves_ANEMOC_1H.csv

Large diffs are not rendered by default.

Binary file modified examples/figures/wind_waves.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/wind_waves_contours.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/figures/wind_waves_simulated_10000.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/figures/wind_waves_woutput.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/wind_waves_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#
data = pd.read_csv("data/wind_waves_ANEMOC_1H.csv", index_col=0)
data = data.iloc[:1000]

# Draw static copulogram on data
data.columns = ["$\\theta_{wind}$", "$U$", "$\\theta_{wave}$", "$H_s$", "$T_p$"]
Expand Down
16 changes: 4 additions & 12 deletions examples/wind_waves_nonparametric_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,9 @@
import copulogram as cp


df_processed = pd.read_csv('data/df_ANEMOC_1H.csv')
all_indexes = df_processed.index.values
saved_columns = ['θ_wind (deg)', 'U_hub (m/s)', 'θ_wave_new (deg)', 'Hs (m)', 'Tp (s)']
df = df_processed.loc[:, saved_columns]

# Monte Carlo sub-sample to make the plots and the fits faster
N = 10000
subsampled_indexes = np.random.choice(all_indexes, N, replace=False)
data = df.loc[subsampled_indexes, saved_columns]
new_columns = ["$\\theta_{wind}$", "$U$", "$\\theta_{wave}$", "$H_s$", "$T_p$"]
data.columns = new_columns
data = pd.read_csv('data/wind_waves_ANEMOC_1H.csv', index_col=0)
data.columns = ["$\\theta_{wind}$", "$U$", "$\\theta_{wave}$", "$H_s$", "$T_p$"]
N = data.shape[0]
# Draw static copulogram on data
copulogram = cp.Copulogram(data, latex=True)
alpha = 0.1
Expand All @@ -43,7 +35,7 @@

WaveDir_data = ot.Sample(data["$\\theta_{wave}$"].values.reshape(-1, 1))
kernel = ot.KernelSmoothing()
mixed_kw = kernel.computeMixedBandwidth(WaveDir_data[:1000])
mixed_kw = kernel.computeMixedBandwidth(WaveDir_data[:2000])
WaveDir_kde = kernel.build(WaveDir_data[:2000], mixed_kw)
WaveDir_kde = ot.TruncatedDistribution(WaveDir_kde, 0., 365.)

Expand Down

0 comments on commit 07271ad

Please sign in to comment.