summaryrefslogtreecommitdiff
path: root/windy/point_forecast.py
diff options
context:
space:
mode:
Diffstat (limited to 'windy/point_forecast.py')
-rw-r--r--windy/point_forecast.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/windy/point_forecast.py b/windy/point_forecast.py
index 7e9304f..8ee4fe2 100644
--- a/windy/point_forecast.py
+++ b/windy/point_forecast.py
@@ -136,6 +136,12 @@ class Prediction:
def levels(self, parameter) -> tuple:
return self._response.levels(parameter)
+ def level(self, parameter, level) -> int:
+ return self._response.level(parameter, level)
+
+ def at(self, parameter, level):
+ return self._response.raw_predictions[parameter][self._index][self.level(parameter, level)]
+
def __iter__(self):
return iter(self.parameters)
@@ -207,6 +213,9 @@ class Response:
def levels(self, parameter) -> tuple:
return self._levels[parameter]
+ def level(self, parameter, level) -> int:
+ return self.levels(parameter).index(Level(level))
+
def predictions(self) -> Prediction:
"""
Yields Prediction for each time point available in this Response.