Browse Source

Merge tag '1.3.0' into develop

- Release 1.3.0
- Fixed FutureWarning issue with destag routine (thank you honnorat!)
- Fixed computational problems with updraft_helicity, and values are no longer
  scaled by 1000.
- Removed version constraints for wrapt and setuptools.
- Fixed xarray being a hard dependency.
- Fixed unit issues with vinterp when pressure values are extracted below
  ground. Also added support for height fields in km and pressure fields in
  hPa. The documentation has been improved.
- Fixed the smooth2d routine so that it actually works. It never worked
  correctly before (nor did it work in NCL). Users can now specify the
  center weight of the kernel and the documentation has been updated to
  describe how it works.
- Fixed the storm relative helicity algorithm so that it works in the southern
  hemisphere. The raw algorithm now requires latitude input if used
  in the southern hemisphere, otherwise the northern hemisphere is assumed.
- Fixed an issue with the latest version of cartopy 0.17 (thanks honnorat!)
- Fixed an issue where invalid keyword arguments weren't throwing errors when
  extracting standard WRF variables.
- Fixed minor issues related to moving nests when using line interpolation and
  vertical cross sections. It is still an error to request all times when
  using lat/lon coordinates with a moving nest, but otherwise knows how to
  run when all times are requested. This never really worked quite right.
- Removed the pyf file from setup.py since it is generated via the build
  system.
- Added an autolevels parameter for the vertical cross section so that users
  can specify the number of vertical levels to use if they don't want to
  specify them manually.
- The interplevel routine has been improved. Users can now specify a single
  level, multiple levels, or a 2D array (e.g. PBLH) to interpolate to.
  Performance has been improved when interpolating a multiple product
  field like wspd_wdir.
- Products that produce multiple outputs can now have the outputs requested
  individually. See :ref:`subdiagnostic-table` for a list of what is available.
- Much of this version of wrf-python has been back ported to NCL in the
  upcoming 6.6.0 release. The diagnostics should produce the same results
  in both packages.
- Now released under the Apache 2.0 license.
lon0
Bill Ladwig 6 years ago
parent
commit
d08197cc1d
  1. 29
      test/ipynb/WRF_python_demo.ipynb
  2. 2
      test/test_filevars.py
  3. 2
      test/test_inputs.py
  4. 4
      test/test_multi_cache.py
  5. 6
      test/varcache.py

29
test/ipynb/WRF_python_demo.ipynb

@ -437,7 +437,7 @@ @@ -437,7 +437,7 @@
"ll = CoordPair(lat=24.0, lon=-87.)\n",
"ur = CoordPair(lat=27.0, lon=-84)\n",
"bounds = GeoBounds(ll, ur)\n",
"reduced_files = FileReduce(glob.glob(\"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/wrfout_d02*\"),\n",
"reduced_files = FileReduce(glob.glob(\"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/moving_nest/wrfout_d02*\"),\n",
" bounds, tempdir=\"/Users/ladwig/mytemp\", delete=False, reuse=True)\n",
"\n",
"slp = getvar(reduced_files, \"slp\")\n",
@ -1098,7 +1098,7 @@ @@ -1098,7 +1098,7 @@
"from wrf import getvar, ALL_TIMES\n",
"from netCDF4 import Dataset as nc\n",
"\n",
"dir = \"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi\"\n",
"dir = \"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/moving_nest\"\n",
"ncfilenames = [os.path.join(dir, x) for x in os.listdir(dir) if x.find(\"_d02_\") > 0]\n",
"ncfiles = [nc(x) for x in ncfilenames]\n",
"\n",
@ -1207,6 +1207,8 @@ @@ -1207,6 +1207,8 @@
"#vard = {varname: getvar(ncfiles, varname, method=\"join\", squeeze=False) for varname in wrf_vars}\n",
"for varname in wrf_vars:\n",
" print(vard[varname])\n",
" \n",
"# NOTE: Warnings below are due to \"join\" and the fill values used since the last file only contains 1 time step.\n",
" "
]
},
@ -1220,7 +1222,7 @@ @@ -1220,7 +1222,7 @@
"from wrf import getvar\n",
"from netCDF4 import Dataset as nc\n",
"\n",
"dir = \"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi\"\n",
"dir = \"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/moving_nest\"\n",
"ncfilenames = [os.path.join(dir, x) for x in os.listdir(dir) if x.find(\"_d02_\") > 0]\n",
"ncfiles = [nc(x) for x in ncfilenames]\n",
"\n",
@ -1257,7 +1259,7 @@ @@ -1257,7 +1259,7 @@
"from wrf import getvar\n",
"from netCDF4 import Dataset as nc\n",
"\n",
"dir = \"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi\"\n",
"dir = \"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/moving_nest\"\n",
"ncfilenames = [os.path.join(dir, x) for x in os.listdir(dir) if x.find(\"_d02_\") > 0]\n",
"ncfiles = [nc(x) for x in ncfilenames]\n",
"\n",
@ -1288,6 +1290,13 @@ @@ -1288,6 +1290,13 @@
"del t2_line, t2"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
@ -1341,7 +1350,7 @@ @@ -1341,7 +1350,7 @@
"from wrf import getvar, ALL_TIMES, geo_bounds, get_cartopy, get_basemap, get_pyngl, cartopy_xlim, cartopy_ylim\n",
"from netCDF4 import Dataset as nc\n",
"\n",
"wrf_filenames = glob(\"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/wrfout_d02_*\")\n",
"wrf_filenames = glob(\"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/moving_nest/wrfout_d02_*\")\n",
"ncfiles = [nc(x) for x in wrf_filenames]\n",
"\n",
"slp = getvar(ncfiles, \"slp\", timeidx=ALL_TIMES)\n",
@ -1403,21 +1412,21 @@ @@ -1403,21 +1412,21 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python 3",
"language": "python",
"name": "python2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.15"
"pygments_lexer": "ipython3",
"version": "3.6.7"
}
},
"nbformat": 4,

2
test/test_filevars.py

@ -7,7 +7,7 @@ import subprocess @@ -7,7 +7,7 @@ import subprocess
from wrf import getvar, ALL_TIMES
TEST_DIR = "/Users/ladwig/Documents/wrf_files/wrf_vortex_multi"
TEST_DIR = "/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/moving_nest"
TEST_FILENAMES = ["wrfout_d02_2005-08-28_00:00:00",
"wrfout_d02_2005-08-28_12:00:00",
"wrfout_d02_2005-08-29_00:00:00"]

2
test/test_inputs.py

@ -12,7 +12,7 @@ from wrf import (getvar, interplevel, interpline, vertcross, vinterp, @@ -12,7 +12,7 @@ from wrf import (getvar, interplevel, interpline, vertcross, vinterp,
extract_global_attrs, viewitems, CoordPair, ll_points)
from wrf.util import is_multi_file
IN_DIR = "/Users/ladwig/Documents/wrf_files/wrf_vortex_multi"
IN_DIR = "/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/moving_nest"
TEST_FILES = [os.path.join(IN_DIR, "wrfout_d02_2005-08-28_00:00:00"),
os.path.join(IN_DIR, "wrfout_d02_2005-08-28_12:00:00"),
os.path.join(IN_DIR, "wrfout_d02_2005-08-29_00:00:00")]

4
test/test_multi_cache.py

@ -5,8 +5,8 @@ from netCDF4 import Dataset as nc @@ -5,8 +5,8 @@ from netCDF4 import Dataset as nc
#a = nc("/Users/ladwig/Documents/wrf_files/wrf_vortex_single/wrfout_d02_2005-08-28_00:00:00")
#b = nc("/Users/ladwig/Documents/wrf_files/wrf_vortex_single/wrfout_d02_2005-08-28_03:00:00")
a = nc("/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/wrfout_d02_2005-08-28_00:00:00")
b = nc("/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/wrfout_d02_2005-08-28_12:00:00")
a = nc("/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/moving_nest/wrfout_d02_2005-08-28_00:00:00")
b = nc("/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/moving_nest/wrfout_d02_2005-08-28_12:00:00")
q = {"outoutoutout" : {"outoutout" : {"outout" : {"out1" : {"blah" : [a,b], "blah2" : [a,b]}, "out2" : {"blah" : [a,b], "blah2" : [a,b]} } } } }
t1 = time.time()

6
test/varcache.py

@ -4,9 +4,9 @@ import time @@ -4,9 +4,9 @@ import time
from netCDF4 import Dataset
from wrf import getvar, ALL_TIMES, extract_vars
wrf_filenames = ["/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/wrfout_d02_2005-08-28_00:00:00",
"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/wrfout_d02_2005-08-28_12:00:00",
"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/wrfout_d02_2005-08-29_00:00:00"]
wrf_filenames = ["/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/moving_nest/wrfout_d02_2005-08-28_00:00:00",
"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/moving_nest/wrfout_d02_2005-08-28_12:00:00",
"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/moving_nest/wrfout_d02_2005-08-29_00:00:00"]
wrfin = [Dataset(x) for x in wrf_filenames]

Loading…
Cancel
Save