diff --git a/docs/assets/kiruna_snodjup.html b/docs/assets/kiruna_snodjup.html new file mode 100644 index 00000000..a7a1f815 --- /dev/null +++ b/docs/assets/kiruna_snodjup.html @@ -0,0 +1,7 @@ + + + +
+
+ + \ No newline at end of file diff --git a/docs/smhi-example.md b/docs/smhi-example.md index 928dd775..aebfa7b5 100644 --- a/docs/smhi-example.md +++ b/docs/smhi-example.md @@ -52,15 +52,57 @@ data = client.get_data(8, 180960, 40) #Get data from specific station data2 = client.get_data(8, 180960) #Get comparison data without the #interpolation. +``` + +Visualise the data: +
+ Scatter plot code -import matplotlib.pyplot as plt -plt.plot(data.df.index, data.df["Snödjup"]) -plt.plot(data2.df.index, data2.df["Snödjup"]) -plt.ylabel("Snödjup") -plt.legend(["Interpolated (40km)", "Station 180960"]) -plt.show() +```python +import plotly.graph_objects as go + +d1 = data.df +d2 = data2.df + +index = d1.index.intersection(d2.index) +d2_dropped = d2.drop(index, axis=0) + +fig = go.Figure() +fig.add_trace( + go.Scattergl( + x=d1.index, + y=d1["Snödjup"], + mode="markers", + name="Kiruna station" + ) +) +fig.add_trace( + go.Scattergl( + x=d2_dropped.index, + y=d2_dropped["Snödjup"], + mode="markers", + name="Interpolerat, radie 40 km" + ) +) +fig.update_layout( + title='Historiskt snödjup i Kiruna', + xaxis_title="År", + yaxis_title="Snödjup [m]", + legend={"orientation": "h"}, + margin={"l": 0, "r": 0, "b": 80, "t": 100} +) + +fig.show() ``` +
+ + + ## Finding data from a city There are a lot of stations available: Frequently, we are simply interested diff --git a/mkdocs.yml b/mkdocs.yml index 8515eeb9..05507878 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,12 +11,14 @@ nav: - "Metfcts": metfcts-example.md - "Mesan": mesan-example.md - "Strang": strang-example.md + - "SMHI": smhi-example.md - Reference: - "Clients": - "Metobs reference": metobs-reference.md - "Metfcts reference": metfcts-reference.md - "Mesan reference": mesan-reference.md - "Strang reference": strang-reference.md + - "SMHI reference": smhi-reference.md - "Models": - "Metobs model": metobs-model.md - "Metfcts model": metfcts-model.md