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
#!/usr/bin/env python | |
from itertools import product | |
from multiprocessing import Pool, Process | |
import numpy as np | |
import xarray as xr | |
import metpy.calc as mpcalc | |
from datetime import datetime |
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
============================= test session starts ============================== | |
platform linux -- Python 3.7.3, pytest-4.6.2, py-1.8.0, pluggy-0.12.0 | |
Matplotlib: 3.0.2 | |
Freetype: 2.6.1 | |
Dependencies: Matplotlib (3.0.2), NumPy (1.17.0), Pandas (0.24.2), Pint (0.10.dev0), SciPy (1.3.0), Xarray (0.14.0+5.g408807c6) | |
rootdir: /home/jon/dev/MetPy, inifile: setup.cfg | |
plugins: flake8-1.0.4, cov-2.7.1, mpl-0.10 | |
collected 123 items | |
tests/calc/test_thermo.py ..............FF............FFFFFFFFFFFFF..... [ 37%] |
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
class StringPreprocessor(object): | |
"""Constructor for a extensible unit expression string preprocessor.""" | |
# List of default replacement pairs | |
_default_replacements = [(",", ""), | |
(" per ", "/"), | |
("^", "**")] | |
# List of default regex substitution pairs. | |
_default_subs_re = [('\N{DEGREE SIGN}', " degree"), |
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
diff --git a/metpy_constants_pint_0_9.txt b/metpy_constants_pint_0_10.txt | |
index e9af145..0558c33 100644 | |
--- a/metpy_constants_pint_0_9.txt | |
+++ b/metpy_constants_pint_0_10.txt | |
@@ -11,10 +11,10 @@ earth_avg_radius | |
6371200.0 meter | |
G | |
-6.673840000000001e-11 meter ** 3 / kilogram / second ** 2 | |
+6.6743e-11 meter ** 3 / kilogram / second ** 2 |
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
============================= test session starts ============================== | |
platform linux -- Python 3.7.3, pytest-4.6.2, py-1.8.0, pluggy-0.12.0 | |
Matplotlib: 3.0.2 | |
Freetype: 2.6.1 | |
Dependencies: Matplotlib (3.0.2), NumPy (1.16.4), Pint (0.10.dev0), SciPy (1.3.0) | |
rootdir: /home/jon/dev/MetPy, inifile: setup.cfg | |
plugins: flake8-1.0.4, cov-2.7.1, mpl-0.10 | |
collected 878 items | |
metpy/calc/tests/test_basic.py ............................FF.F.....F... [ 4%] |
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
from wrf import getvar | |
from netCDF4 import Dataset | |
import xarray as xr | |
import pyproj | |
# Extract the variables of interest at time index 17 | |
ds = Dataset('../wrfout_d02_2015-07-12_1200.nc') | |
variables = [getvar(ds, var, 17) for var in ('z', 'dbz', 'pressure', 'ter', 'ua', | |
'va', 'wa', 'temp', 'rh')] | |
data = xr.merge(variables) |
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
import numpy as np | |
import pyproj | |
import xarray as xr | |
# Generate LCC Grid | |
def generate_lcc_grid(nx = 532, ny = 532, dx = 3000., dy = 3000., | |
central_latitude = 39.05, central_longitude = -95.68, | |
standard_parallels = 39.05, | |
globe_kwargs = {'a': 6370000, 'b': 6370000}): | |
# Inputs default to Squiteri and Gallus (2016) WRF grid |