forked from earthobservations/wetterdienst
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tutorial stub based on iPython Sphinx extension
- Loading branch information
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
######## | ||
Tutorial | ||
######## | ||
|
||
# wetterdienst - A simple example | ||
|
||
.. ipython:: | ||
|
||
In [1]: x = 3 | ||
|
||
In [2]: y = x**2 | ||
|
||
In [3]: print(y) | ||
|
||
# Import modules necessary for general functioning | ||
|
||
In [4]: import warnings | ||
...: warnings.filterwarnings("ignore") | ||
...: import wetterdienst | ||
...: #from wetterdienst import PeriodType, TimeResolution, Parameter | ||
...: import matplotlib as mpl | ||
...: import matplotlib.pyplot as plt | ||
...: from matplotlib import cm | ||
|
||
# Which parameters are available? | ||
|
||
In [5]: print("All available combinations") | ||
...: print(wetterdienst.discover_climate_observations()) | ||
...: print("Selection of daily historical data") | ||
...: print( | ||
...: discover_climate_observations( | ||
...: time_resolution=TimeResolution.DAILY, | ||
...: period_type=PeriodType.HISTORICAL | ||
...: ) | ||
...: ) | ||
|
||
In [6]: metadata_hdp = wetterdienst.metadata_for_climate_observations( | ||
...: Parameter.PRECIPITATION_MORE, TimeResolution.DAILY, PeriodType.HISTORICAL) | ||
...: print("Number of stations with available data: ", metadata_hdp["HAS_FILE"].sum()) | ||
...: print("Some of the stations:") | ||
...: metadata_hdp.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters