diff options
Diffstat (limited to 'metchart')
-rwxr-xr-x | metchart/aggregator/dwd_icon.py | 2 | ||||
-rw-r--r-- | metchart/aggregator/misc.py | 23 | ||||
-rwxr-xr-x | metchart/plotter/horizontal.py | 2 | ||||
-rwxr-xr-x | metchart/plotter/vertical_from_grib.py | 4 |
4 files changed, 4 insertions, 27 deletions
diff --git a/metchart/aggregator/dwd_icon.py b/metchart/aggregator/dwd_icon.py index ed5c149..3a3eace 100755 --- a/metchart/aggregator/dwd_icon.py +++ b/metchart/aggregator/dwd_icon.py @@ -13,7 +13,7 @@ import subprocess import xarray as xr -from . import misc +from .. import misc BASE='https://opendata.dwd.de/weather/nwp' diff --git a/metchart/aggregator/misc.py b/metchart/aggregator/misc.py deleted file mode 100644 index 6594d0f..0000000 --- a/metchart/aggregator/misc.py +++ /dev/null @@ -1,23 +0,0 @@ -import os -import numpy as np -import datetime - -def np_time_convert(dt64, func=datetime.datetime.utcfromtimestamp): - unix_epoch = np.datetime64(0, 's') - one_second = np.timedelta64(1, 's') - seconds_since_epoch = (dt64 - unix_epoch) / one_second - - return func(seconds_since_epoch) - -def np_time_convert_offset(init, step): - return np_time_convert(init) + np_time_convert(step, func=lambda x: datetime.timedelta(seconds=x)) - -def np_time_list_convert_offset(init, steps): - return list(map(lambda x: np_time_convert_offset(init, x), steps)) - -def create_output_dir(path, clear=False): - if not os.path.exists(path): - os.makedirs(path) - elif clear: - raise Exception('clear not implemented') - diff --git a/metchart/plotter/horizontal.py b/metchart/plotter/horizontal.py index 7b35def..e481f82 100755 --- a/metchart/plotter/horizontal.py +++ b/metchart/plotter/horizontal.py @@ -8,7 +8,7 @@ import numpy as np import matplotlib.pyplot as plt from metpy.plots import MapPanel, PanelContainer, RasterPlot, ContourPlot -from . import misc +from .. import misc config = { 'source': 'dwd_icon-eu/combined.grib2', diff --git a/metchart/plotter/vertical_from_grib.py b/metchart/plotter/vertical_from_grib.py index d341389..2c636f0 100755 --- a/metchart/plotter/vertical_from_grib.py +++ b/metchart/plotter/vertical_from_grib.py @@ -11,9 +11,9 @@ from metpy.units import units import metpy.calc as mpcalc import numpy as np -import skewt +from .. import skewt -from . import misc +from .. import misc config = { 'source':'dwd_icon-eu/combined.grib2', |