Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/files/Heatmap_monthly_yearly.png
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 docs/files/Heatmap_yearly_profiles_wind.png
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 docs/files/Linear_regression.png
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 docs/files/Yearly_stripes.png
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 docs/files/Yearly_vertical_profiles_current.png
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 docs/files/Yearly_vertical_profiles_wind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions docs/files/table_linear_regression.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
index,LS_slope,LS_intercept,LS_r_square,TS_slope,TS_intercept,TS_slope_lower,TS_slope_upper,Kendall_tau,Kendal_p_value
jan.,0.029711207446130317,-55.36514088996559,0.11816382666464985,0.025655241935483797,-47.54730342741921,-0.0126008064516129,0.07096774193548384,0.1948051948051948,0.21747455727039447
feb.,-0.027866959956941727,57.608486263014086,0.11845730198747513,-0.028593749999999973,59.087466517857095,-0.06592261904761913,0.015277777777777748,-0.1948051948051948,0.21747455727039447
mars,0.01768501484490265,-32.16031242600319,0.03870303537700306,0.024264705882352945,-45.23926707779887,-0.009879032258064477,0.055181451612903235,0.26406926406926406,0.09079907642795323
april,0.0010476661020139201,0.005907914549234672,0.00024411362841211584,-0.002440476190476223,6.795535714285778,-0.030000000000000027,0.040722222222222194,-0.021645021645021644,0.9112884689584274
mai,-0.009514398644833414,20.37348522795575,0.04579936634814474,-0.01908602150537633,39.273252688172015,-0.033064516129032384,0.006634897360703793,-0.2727272727272727,0.08028526277549888
juni,-0.004398174289478636,10.135343967626573,0.014806729237167148,-0.003541666666666776,8.47114583333355,-0.02124999999999999,0.015708333333333324,-0.05627705627705628,0.7380940484479567
juli,-0.005692974627055975,12.650315568022442,0.0337516274921531,-0.0015552995391705199,4.504349078341039,-0.021054147465437816,0.009646401985111668,-0.0303030303030303,0.8672669832921104
aug.,0.0008877342853499994,-0.349576055080975,0.0008189992079955256,0.0018548387096774198,-2.2734274193548396,-0.013164136622390884,0.017679900744416884,0.0303030303030303,0.8672669832921104
sep.,0.03726661020139281,-71.31799642386599,0.36449213098047584,0.04026041666666669,-77.17263020833337,0.013229166666666653,0.0629166666666667,0.4458874458874459,0.003207140388506757
okt.,0.017707327735378236,-32.37476321014191,0.07780296692937472,0.014536290322580636,-26.135252016129012,-0.0141633064516129,0.054233870967742126,0.2121212121212121,0.17796763426213033
nov.,0.02891821946169772,-54.03596955580651,0.20230887953096446,0.030370370370370332,-56.882199074074,0.0009444444444444736,0.06178030303030304,0.316017316017316,0.041288634586930426
des.,0.010406003533633251,-17.15056692956409,0.020622058640743835,0.013709677419354804,-23.67379032258058,-0.021572580645161283,0.05241935483870974,0.16017316017316016,0.31397950542939346
Year,0.008189232868174282,-13.846941088045558,0.2010254722688341,0.009867492576789694,-17.135340644259827,0.0012875215210719215,0.017266500622665003,0.35064935064935066,0.022775270000007175
109 changes: 109 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1990,6 +1990,115 @@ Taylor diagram
.. image:: files/Taylor_diagram.png
:width: 500


Climate and trends
==================
Yearly stripes
--------------

.. code-block:: python

plots.plot_yearly_stripes(
df,
var_name='HS',
method= 'mean',
ylabel='Hs [m]',
output_file='Yearly_stripes.png')

.. image:: files/Yearly_stripes.png
:width: 500

Monthly and yearly heatmap
--------------------------

.. code-block:: python

plots.plot_heatmap_monthly_yearly(
df,
var_name='T2m',
method= 'mean',
cb_label='2-m temperature [°C]',
output_file='Heatmap_monthly_yearly.png')

.. image:: files/Heatmap_monthly_yearly.png
:width: 500

Yearly vertical profiles
------------------------

.. code-block:: python

plots.plot_yearly_vertical_profiles(
df,
rad_colname='current_speed_',
method= 'mean',
yaxis_direction='down',
xlabel='Current speed [m/s]',
output_file='Yearly_vertical_profiles_current.png')

.. image:: files/Yearly_vertical_profiles_current.png
:width: 500

.. code-block:: python

plots.plot_yearly_vertical_profiles(
df,
rad_colname='W',
method= 'mean',
yaxis_direction='up',
xlabel='Wind speed [m/s]',
output_file='Yearly_vertical_profiles_wind.png')

.. image:: files/Yearly_vertical_profiles_wind.png
:width: 500

.. code-block:: python

plots.plot_heatmap_profiles_yearly(
df,
rad_colname='W',
cb_label='Wind speed [m/s]',
yaxis_direction='up',
method='P80',
output_file='Heatmap_yearly_profiles_wind.png')

.. image:: files/Heatmap_yearly_profiles_wind.png
:width: 500

Linear regression Plot and Table
--------------------------------

.. code-block:: python

plots.plot_yearly_vertical_profiles(
df,
var='HS',
time='Year',
stat='P70',
method=['Least-Squares','Theil-Sen'],
confidence_interval=0.95,
ylabel='Hs [m]',
output_figure='Linear_regression.png')

.. image:: files/Linear_regression.png
:width: 500

.. code-block:: python

tables.table_linear_regression(
df,
var='HS',
stat='mean',
method=['Least-Squares','Theil-Sen','Kendall-tau'],
confidence_interval=0.95,
intercept=True,
output_file='table_linear_regression.csv'
)

.. csv-table::
:header-rows: 1
:file: files/table_linear_regression.csv

Auxiliary Functions
===================

Expand Down
3 changes: 2 additions & 1 deletion examples/example_NORA_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
# # fig = plots.plot_profile_monthly_stats(ds_ocean, var=['temp_' + d for d in depth], z=[float(d[:-1]) for d in depth], method='minimum',title='Min. Sea Temperature [°C]', output_file='plot_min_temp_profile_monthly_stats.png')
# # fig = plots.plot_profile_monthly_stats(ds_ocean, var=['temp_' + d for d in depth], z=[float(d[:-1]) for d in depth], method='maximum',title='Max. Sea Temperature [°C]', output_file='plot_max_temp_profile_monthly_stats.png')

# # # Sainity:
# # # Salinity:
# # df = tables.table_profile_monthly_stats(ds_ocean, var=['salt_' + d for d in depth], z=[float(d[:-1]) for d in depth], method='mean', output_file='table_mean_sal_profile_monthly_stats.png')
# # df = tables.table_profile_monthly_stats(ds_ocean, var=['salt_' + d for d in depth], z=[float(d[:-1]) for d in depth], method='std.dev', output_file='table_std_sal_profile_monthly_stats.png')
# # df = tables.table_profile_monthly_stats(ds_ocean, var=['salt_' + d for d in depth], z=[float(d[:-1]) for d in depth], method='minimum', output_file='table_min_sal_profile_monthly_stats.png')
Expand All @@ -150,3 +150,4 @@
# #fig = plots.plot_storm_surge_for_given_hs(df,var_surge='zeta_0m', var_hs='HS', max_hs=20, output_file='surge_for_given_hs.png')
# #df = tables.table_extreme_total_water_level(df, var_hs='HS',var_tp='TP',var_surge='zeta_0m', var_tide='tide', periods=[100,10000], output_file='table_extreme_total_water_level.csv')
# #df = tables.table_storm_surge_for_rv_hs(df, var_hs='HS',var_tp='TP',var_surge='zeta_0m', var_tide='tide', periods=[1,10,100,10000],depth=200, output_file='table_storm_surge_for_rv_hs.csv')
# #tide_type = stats.tidal_type(ds_tide,var='tide')
1 change: 1 addition & 0 deletions metocean_stats/plots/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
from .extreme import *
from .general import *
from .verification import *
from .climate import *
from .spectra import *
Loading
Loading