Browse Source

Added fix for issues from xarray 0.9, which was caused by xarray no longer including default dimensions in to coordinate mappings. Updated documentation and notebooks. Modified documentation URL in setup. Dropping requirement for numpy 1.9

main 1.0b2
Bill Ladwig 8 years ago
parent
commit
b4b4677c15
  1. 2
      README.md
  2. 32
      conda_recipe/LICENSE
  3. 19
      conda_recipe/meta.yaml
  4. BIN
      doc/source/_static/images/basemap_500.png
  5. BIN
      doc/source/_static/images/basemap_front.png
  6. BIN
      doc/source/_static/images/basemap_slp.png
  7. BIN
      doc/source/_static/images/cartopy_500.png
  8. BIN
      doc/source/_static/images/cartopy_cross.png
  9. BIN
      doc/source/_static/images/cartopy_slp.png
  10. BIN
      doc/source/_static/images/matthew.png
  11. BIN
      doc/source/_static/images/matthew_cross.png
  12. 284
      doc/source/basic_usage.rst
  13. 22
      doc/source/index.rst
  14. 11
      doc/source/new.rst
  15. 207
      doc/source/plot.rst
  16. 2
      requirements.txt
  17. 2
      setup.py
  18. 2
      src/wrf/version.py
  19. 418
      test/ipynb/Doc_Examples.ipynb
  20. 125
      test/ipynb/SLS_Example.ipynb
  21. 19
      test/ipynb/WRF_Workshop_Demo.ipynb
  22. 18834
      test/ipynb/WRF_python_demo.ipynb

2
README.md

@ -11,5 +11,5 @@ Installation via conda: @@ -11,5 +11,5 @@ Installation via conda:
Documentation is available at:
http://wrf-python.readthedocs.io
http://wrf-python.rtfd.org

32
conda_recipe/LICENSE

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
PLEASE READ THIS SOFTWARE LICENSE ("LICENSE") CAREFULLY BEFORE USING THE
SOFTWARE. BY USING THE SOFTWARE, YOU ARE AGREEING TO BE BOUND BY ALL OF THE
TERMS OF THIS LICENSE. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE,
DO NOT USE THE SOFTWARE.
Copyright © 2016 the University Corporation for Atmospheric Research ("UCAR").
All rights reserved. Developed by NCAR's Computational and Information Systems
Laboratory, UCAR, www2.cisl.ucar.edu.
Redistribution and use of the Software in source and binary forms, with or
without modification, is permitted provided that the following conditions
are met:
- Neither the names of NCAR's Computational and Information Systems Laboratory,
the University Corporation for Atmospheric Research, nor the names of its
sponsors or contributors may be used to endorse or promote products derived
from this Software without specific prior written permission.
- Redistributions of source code must retain the above copyright notices, this
list of conditions, and the disclaimer below.
- Redistributions in binary form must reproduce the above copyright notice, this
list of conditions, and the disclaimer below in the documentation and/or other
materials provided with the distribution.
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.

19
conda_recipe/meta.yaml

@ -12,41 +12,32 @@ source: @@ -12,41 +12,32 @@ source:
build:
number: 1
detect_binary_files_with_prefix: true
skip: True # [win32 or np>=112 or (win and py>=35)]
skip: True # [win32 or (win and py>=35)]
requirements:
build:
- pip
- setuptools
- numpy x.x
- wrapt
- m2w64-toolchain # [win]
- gcc # [unix]
- libgcc # [unix]
- python
- vc 9 # [win and py27]
- vc 10 # [win and py34]
- vc 14 # [win and py>=35]
run:
- numpy x.x
- python
- wrapt
- m2w64-toolchain # [win]
- gcc # [unix]
- libgfortran # [unix]
- libgcc # [unix]
- xarray
- vc 9 # [win and py27]
- vc 10 # [win and py34]
- vc 14 # [win and py>=35]
test:
requires:
- nose
imports:
- wrf
about:
home: https://github.com/NCAR/wrf-python
license: "NCL Source Code"
license: "UCAR"
license_file: '{{ environ["RECIPE_DIR"] }}/LICENSE'
summary: "Diagnostic and interpolation routines for WRF-ARW data."
extra:

BIN
doc/source/_static/images/basemap_500.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 229 KiB

BIN
doc/source/_static/images/basemap_front.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 86 KiB

BIN
doc/source/_static/images/basemap_slp.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 144 KiB

BIN
doc/source/_static/images/cartopy_500.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 279 KiB

BIN
doc/source/_static/images/cartopy_cross.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 30 KiB

BIN
doc/source/_static/images/cartopy_slp.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 161 KiB

BIN
doc/source/_static/images/matthew.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 84 KiB

BIN
doc/source/_static/images/matthew_cross.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

284
doc/source/basic_usage.rst

@ -36,25 +36,24 @@ Result: @@ -36,25 +36,24 @@ Result:
.. code-block:: none
<xarray.DataArray u'slp' (south_north: 1059, west_east: 1799)>
array([[ 1012.22033691, 1012.29815674, 1012.24786377, ...,
1010.13201904, 1009.93231201, 1010.06707764],
[ 1012.43286133, 1012.44476318, 1012.33666992, ...,
1010.1072998 , 1010.10845947, 1010.04760742],
[ 1012.39544678, 1012.38085938, 1012.41705322, ...,
1010.22937012, 1010.05596924, 1010.02679443],
array([[ 1012.220337, 1012.298157, 1012.247864, ..., 1010.132019,
1009.932312, 1010.067078],
[ 1012.432861, 1012.444763, 1012.33667 , ..., 1010.1073 ,
1010.108459, 1010.047607],
[ 1012.395447, 1012.380859, 1012.417053, ..., 1010.22937 ,
1010.055969, 1010.026794],
...,
[ 1009.0423584 , 1009.06921387, 1008.98779297, ...,
1019.19281006, 1019.14434814, 1019.1105957 ],
[ 1009.22485352, 1009.07513428, 1008.98638916, ...,
1019.07189941, 1019.04266357, 1019.0612793 ],
[ 1009.18896484, 1009.1071167 , 1008.97979736, ...,
1018.91778564, 1018.95684814, 1019.04748535]], dtype=float32)
[ 1009.042358, 1009.069214, 1008.987793, ..., 1019.19281 ,
1019.144348, 1019.110596],
[ 1009.224854, 1009.075134, 1008.986389, ..., 1019.071899,
1019.042664, 1019.061279],
[ 1009.188965, 1009.107117, 1008.979797, ..., 1018.917786,
1018.956848, 1019.047485]], dtype=float32)
Coordinates:
XLONG (south_north, west_east) float32 -122.72 -122.693 -122.666 ...
XLAT (south_north, west_east) float32 21.1381 21.1451 21.1521 ...
Time datetime64[ns] 2016-10-07
* south_north (south_north) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
* west_east (west_east) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
Dimensions without coordinates: south_north, west_east
Attributes:
FieldType: 104
MemoryOrder: XY
@ -62,10 +61,10 @@ Result: @@ -62,10 +61,10 @@ Result:
units: hPa
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
.. _extract_ncvars:
@ -94,26 +93,35 @@ Result: @@ -94,26 +93,35 @@ Result:
.. code-block:: none
<xarray.DataArray u'P' (bottom_top: 50, south_north: 1059, west_east: 1799)>
array([[[ 1.21753906e+03, 1.22532031e+03, 1.22030469e+03, ...,
1.00760156e+03, 9.87640625e+02, 1.00111719e+03],
[ 1.23877344e+03, 1.24004688e+03, 1.22926562e+03, ...,
1.00519531e+03, 1.00529688e+03, 9.99171875e+02],
[ 1.23503906e+03, 1.23367188e+03, 1.23731250e+03, ...,
1.01739844e+03, 1.00005469e+03, 9.97093750e+02],
array([[[ 1.217539e+03, 1.225320e+03, ..., 9.876406e+02, 1.001117e+03],
[ 1.238773e+03, 1.240047e+03, ..., 1.005297e+03, 9.991719e+02],
...,
[ 1.77978516e+00, 1.77050781e+00, 1.79003906e+00, ...,
4.22949219e+00, 4.25659180e+00, 4.13647461e+00],
[ 1.73291016e+00, 1.76879883e+00, 1.77978516e+00, ...,
4.24047852e+00, 4.24707031e+00, 4.13549805e+00],
[ 1.71533203e+00, 1.65722656e+00, 1.67480469e+00, ...,
4.06884766e+00, 4.03637695e+00, 4.04785156e+00]]], dtype=float32)
[ 9.208594e+02, 9.059141e+02, ..., 1.902922e+03, 1.904805e+03],
[ 9.172734e+02, 9.091094e+02, ..., 1.894375e+03, 1.903422e+03]],
[[ 1.219562e+03, 1.210273e+03, ..., 9.973984e+02, 9.907891e+02],
[ 1.224578e+03, 1.223508e+03, ..., 9.985547e+02, 9.921172e+02],
...,
[ 9.012734e+02, 9.052031e+02, ..., 1.897766e+03, 1.894500e+03],
[ 9.137500e+02, 9.071719e+02, ..., 1.893273e+03, 1.893664e+03]],
...,
[[ 7.233154e+00, 7.224121e+00, ..., 3.627930e+00, 3.613770e+00],
[ 7.226318e+00, 7.358154e+00, ..., 3.725098e+00, 3.634033e+00],
...,
[ 5.354248e+00, 5.406006e+00, ..., 1.282715e+01, 1.264844e+01],
[ 5.295410e+00, 5.177490e+00, ..., 1.256274e+01, 1.257642e+01]],
[[ 2.362061e+00, 2.376221e+00, ..., 1.151367e+00, 1.156982e+00],
[ 2.342529e+00, 2.403809e+00, ..., 1.198486e+00, 1.155273e+00],
...,
[ 1.732910e+00, 1.768799e+00, ..., 4.247070e+00, 4.135498e+00],
[ 1.715332e+00, 1.657227e+00, ..., 4.036377e+00, 4.047852e+00]]], dtype=float32)
Coordinates:
XLONG (south_north, west_east) float32 -122.72 -122.693 -122.666 ...
XLAT (south_north, west_east) float32 21.1381 21.1451 21.1521 ...
Time datetime64[ns] 2016-10-07
* bottom_top (bottom_top) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
* south_north (south_north) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
* west_east (west_east) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
Dimensions without coordinates: bottom_top, south_north, west_east
Attributes:
FieldType: 104
MemoryOrder: XYZ
@ -121,10 +129,9 @@ Result: @@ -121,10 +129,9 @@ Result:
units: Pa
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
Disabling xarray and metadata
@ -267,10 +274,8 @@ Result: @@ -267,10 +274,8 @@ Result:
XLONG (south_north, west_east) float32 -122.72 -122.693 -122.666 ...
XLAT (south_north, west_east) float32 21.1381 21.1451 21.1521 ...
* Time (Time) datetime64[ns] 2016-10-07 2016-10-07 2016-10-07
* bottom_top (bottom_top) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
* south_north (south_north) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
* west_east (west_east) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
datetime (Time) datetime64[ns] 2016-10-07T00:00:00 ...
Dimensions without coordinates: bottom_top, south_north, west_east
Attributes:
FieldType: 104
MemoryOrder: XYZ
@ -278,10 +283,9 @@ Result: @@ -278,10 +283,9 @@ Result:
units: Pa
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
Combining Multiple Files Using the 'join' Method
@ -326,28 +330,19 @@ Result: @@ -326,28 +330,19 @@ Result:
.. code-block:: none
<xarray.DataArray u'P' (file: 3, bottom_top: 50, south_north: 1059, west_east: 1799)>
array([[[[ 1.21753906e+03, 1.22532031e+03, 1.22030469e+03, ...,
1.00760156e+03, 9.87640625e+02, 1.00111719e+03],
[ 1.23877344e+03, 1.24004688e+03, 1.22926562e+03, ...,
1.00519531e+03, 1.00529688e+03, 9.99171875e+02],
[ 1.23503906e+03, 1.23367188e+03, 1.23731250e+03, ...,
1.01739844e+03, 1.00005469e+03, 9.97093750e+02],
array([[[[ 1.217539e+03, ..., 1.001117e+03],
...,
[ 1.77978516e+00, 1.77050781e+00, 1.79003906e+00, ...,
4.22949219e+00, 4.25659180e+00, 4.13647461e+00],
[ 1.73291016e+00, 1.76879883e+00, 1.77978516e+00, ...,
4.24047852e+00, 4.24707031e+00, 4.13549805e+00],
[ 1.71533203e+00, 1.65722656e+00, 1.67480469e+00, ...,
4.06884766e+00, 4.03637695e+00, 4.04785156e+00]]]], dtype=float32)
[ 9.172734e+02, ..., 1.903422e+03]],
...,
[[ 2.362061e+00, ..., 1.156982e+00],
...,
[ 1.715332e+00, ..., 4.047852e+00]]]], dtype=float32)
Coordinates:
XLONG (south_north, west_east) float32 -122.72 -122.693 -122.666 ...
XLAT (south_north, west_east) float32 21.1381 21.1451 21.1521 ...
* bottom_top (bottom_top) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
* south_north (south_north) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
* west_east (west_east) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
* file (file) int64 0 1 2
datetime (file) datetime64[ns] 2016-10-07T00:00:00 ...
Time int64 0
datetime (file) datetime64[ns] 2016-10-07 ...
Dimensions without coordinates: bottom_top, south_north, west_east
Attributes:
FieldType: 104
MemoryOrder: XYZ
@ -355,10 +350,9 @@ Result: @@ -355,10 +350,9 @@ Result:
units: Pa
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
Note how the 'Time' dimension was replaced with the 'file' dimension, due to the
@ -388,28 +382,20 @@ Result @@ -388,28 +382,20 @@ Result
.. code-block:: none
<xarray.DataArray u'P' (file: 3, Time: 1, bottom_top: 50, south_north: 1059, west_east: 1799)>
array([[[[[ 1.21753906e+03, 1.22532031e+03, 1.22030469e+03, ...,
1.00760156e+03, 9.87640625e+02, 1.00111719e+03],
[ 1.23877344e+03, 1.24004688e+03, 1.22926562e+03, ...,
1.00519531e+03, 1.00529688e+03, 9.99171875e+02],
[ 1.23503906e+03, 1.23367188e+03, 1.23731250e+03, ...,
1.01739844e+03, 1.00005469e+03, 9.97093750e+02],
array([[[[[ 1.217539e+03, ..., 1.001117e+03],
...,
[ 1.77978516e+00, 1.77050781e+00, 1.79003906e+00, ...,
4.22949219e+00, 4.25659180e+00, 4.13647461e+00],
[ 1.73291016e+00, 1.76879883e+00, 1.77978516e+00, ...,
4.24047852e+00, 4.24707031e+00, 4.13549805e+00],
[ 1.71533203e+00, 1.65722656e+00, 1.67480469e+00, ...,
4.06884766e+00, 4.03637695e+00, 4.04785156e+00]]]]], dtype=float32)
[ 9.172734e+02, ..., 1.903422e+03]],
...,
[[ 2.362061e+00, ..., 1.156982e+00],
...,
[ 1.715332e+00, ..., 4.047852e+00]]]]], dtype=float32)
Coordinates:
XLONG (south_north, west_east) float32 -122.72 -122.693 -122.666 ...
XLAT (south_north, west_east) float32 21.1381 21.1451 21.1521 ...
* bottom_top (bottom_top) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
* south_north (south_north) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
* west_east (west_east) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
* file (file) int64 0 1 2
datetime (file, Time) datetime64[ns] 2016-10-07T00:00:00 ...
* Time (Time) int64 0
datetime (file, Time) datetime64[ns] 2016-10-07 2016-10-07 2016-10-07
Dimensions without coordinates: Time, bottom_top, south_north, west_east
Attributes:
FieldType: 104
MemoryOrder: XYZ
@ -417,10 +403,9 @@ Result @@ -417,10 +403,9 @@ Result
units: Pa
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
Dictionaries of WRF File Sequences
@ -459,28 +444,21 @@ Result: @@ -459,28 +444,21 @@ Result:
.. code-block:: none
<xarray.DataArray 'P' (key_0: 2, Time: 2, bottom_top: 50, south_north: 1059, west_east: 1799)>
array([[[[[ 1.21753906e+03, 1.22532031e+03, 1.22030469e+03, ...,
1.00760156e+03, 9.87640625e+02, 1.00111719e+03],
[ 1.23877344e+03, 1.24004688e+03, 1.22926562e+03, ...,
1.00519531e+03, 1.00529688e+03, 9.99171875e+02],
[ 1.23503906e+03, 1.23367188e+03, 1.23731250e+03, ...,
1.01739844e+03, 1.00005469e+03, 9.97093750e+02],
array([[[[[ 1.217539e+03, ..., 1.001117e+03],
...,
[ 1.77978516e+00, 1.77050781e+00, 1.79003906e+00, ...,
4.22949219e+00, 4.25659180e+00, 4.13647461e+00],
[ 1.73291016e+00, 1.76879883e+00, 1.77978516e+00, ...,
4.24047852e+00, 4.24707031e+00, 4.13549805e+00],
[ 1.71533203e+00, 1.65722656e+00, 1.67480469e+00, ...,
4.06884766e+00, 4.03637695e+00, 4.04785156e+00]]]]], dtype=float32)
[ 9.172734e+02, ..., 1.903422e+03]],
...,
[[ 2.362061e+00, ..., 1.156982e+00],
...,
[ 1.715332e+00, ..., 4.047852e+00]]]]], dtype=float32)
Coordinates:
XLONG (south_north, west_east) float32 -122.72 -122.693 -122.666 ...
XLAT (south_north, west_east) float32 21.1381 21.1451 21.1521 ...
* Time (Time) datetime64[ns] 2016-10-07T00:00:00 ...
* bottom_top (bottom_top) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
* south_north (south_north) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
* west_east (west_east) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
datetime (Time) datetime64[ns] 2016-10-07T00:00:00 ...
* key_0 (key_0) <U6 u'ens1' u'ens2'
* Time (Time) datetime64[ns] 2016-10-07 ...
datetime (Time) datetime64[ns] 2016-10-07 ...
* key_0 (key_0) <U6 u'label1' u'label2'
Dimensions without coordinates: bottom_top, south_north, west_east
Attributes:
FieldType: 104
MemoryOrder: XYZ
@ -488,10 +466,9 @@ Result: @@ -488,10 +466,9 @@ Result:
units: Pa
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
Interpolation Routines
--------------------------
@ -542,17 +519,15 @@ Result: @@ -542,17 +519,15 @@ Result:
XLONG (south_north, west_east) float32 -122.72 -122.693 -122.666 ...
XLAT (south_north, west_east) float32 21.1381 21.1451 21.1521 ...
Time datetime64[ns] 2016-10-07
* south_north (south_north) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
* west_east (west_east) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
Dimensions without coordinates: south_north, west_east
Attributes:
FieldType: 104
units: m
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
level: 500 hPa
missing_value: 9.96920996839e+36
_FillValue: 9.96920996839e+36
@ -623,17 +598,16 @@ Result: @@ -623,17 +598,16 @@ Result:
Time datetime64[ns] 2016-10-07
xy_loc (idx) object CoordPair(x=0.0, y=529.0, lat=34.5279502869, lon=-127.398925781) ...
* vertical (vertical) float32 0.0 261.828 523.656 785.484 1047.31 1309.14 ...
* idx (idx) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
Dimensions without coordinates: idx
Attributes:
FieldType: 104
description: pressure
units: hPa
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
orientation: (0.0, 529.0) to (1797.0, 529.0)
missing_value: 9.96920996839e+36
_FillValue: 9.96920996839e+36
@ -689,17 +663,16 @@ Result: @@ -689,17 +663,16 @@ Result:
Time datetime64[ns] 2016-10-07
xy_loc (idx) object CoordPair(x=0.0, y=529.0, lat=34.5279502869, lon=-127.398925781) ...
* vertical (vertical) float32 0.0 261.828 523.656 785.484 1047.31 1309.14 ...
* idx (idx) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
Dimensions without coordinates: idx
Attributes:
FieldType: 104
description: pressure
units: hPa
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
orientation: (0.0, 529.0) to (1797.0, 529.0) ; center=CoordPair(x=899.0, y=529.0) ; angle=90.0
missing_value: 9.96920996839e+36
_FillValue: 9.96920996839e+36
@ -760,17 +733,16 @@ Result: @@ -760,17 +733,16 @@ Result:
Time datetime64[ns] 2016-10-07
xy_loc (idx) object CoordPair(x=0.0, y=529.0, lat=34.5279502869, lon=-127.398925781) ...
* vertical (vertical) float32 0.0 261.828 523.656 785.484 1047.31 1309.14 ...
* idx (idx) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
Dimensions without coordinates: idx
Attributes:
FieldType: 104
description: pressure
units: hPa
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
orientation: (0.0, 529.0) to (1797.0, 529.0)
missing_value: 9.96920996839e+36
_FillValue: 9.96920996839e+36
@ -827,17 +799,16 @@ Result: @@ -827,17 +799,16 @@ Result:
Time datetime64[ns] 2016-10-07
xy_loc (idx) object CoordPair(x=0.0, y=529.0, lat=34.5279502869, lon=-127.398925781) ...
* vertical (vertical) float32 1000.0 2000.0 3000.0
* idx (idx) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
Dimensions without coordinates: idx
Attributes:
FieldType: 104
description: pressure
units: hPa
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
orientation: (0.0, 529.0) to (1797.0, 529.0)
missing_value: 9.96920996839e+36
_FillValue: 9.96920996839e+36
@ -893,17 +864,16 @@ Result: @@ -893,17 +864,16 @@ Result:
Coordinates:
Time datetime64[ns] 2016-10-07
xy_loc (line_idx) object CoordPair(x=899.0, y=0.0, lat=24.3645858765, lon=-97.5) ...
* line_idx (line_idx) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...
Dimensions without coordinates: line_idx
Attributes:
FieldType: 104
description: TEMP at 2 M
units: K
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
orientation: (899.0, 0.0) to (899.0, 1057.0)
@ -943,17 +913,16 @@ Result: @@ -943,17 +913,16 @@ Result:
Coordinates:
Time datetime64[ns] 2016-10-07
xy_loc (line_idx) object CoordPair(x=899.0, y=0.0, lat=24.3645858765, lon=-97.5) ...
* line_idx (line_idx) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...
Dimensions without coordinates: line_idx
Attributes:
FieldType: 104
description: TEMP at 2 M
units: K
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
orientation: (899.0, 0.0) to (899.0, 1057.0) ; center=CoordPair(x=899, y=529) ; angle=0.0
@ -1001,17 +970,16 @@ Result: @@ -1001,17 +970,16 @@ Result:
Coordinates:
Time datetime64[ns] 2016-10-07
xy_loc (line_idx) object CoordPair(x=899.0, y=0.0, lat=24.3645858765, lon=-97.5) ...
* line_idx (line_idx) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...
Dimensions without coordinates: line_idx
Attributes:
FieldType: 104
description: TEMP at 2 M
units: K
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
orientation: (899.0, 0.0) to (899.0, 1057.0)
@ -1067,9 +1035,8 @@ Result: @@ -1067,9 +1035,8 @@ Result:
XLONG (south_north, west_east) float32 -122.72 -122.693 -122.666 ...
XLAT (south_north, west_east) float32 21.1381 21.1451 21.1521 ...
Time datetime64[ns] 2016-10-07
* south_north (south_north) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
* west_east (west_east) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
* interp_level (interp_level) int64 200 300 500 1000
Dimensions without coordinates: south_north, west_east
Attributes:
FieldType: 104
MemoryOrder: XYZ
@ -1077,10 +1044,9 @@ Result: @@ -1077,10 +1044,9 @@ Result:
units: K
stagger:
coordinates: XLONG XLAT
projection: LambertConformal(bottom_left=(21.138123, -122.71953),
top_right=(47.843636, -60.901367), stand_lon=-97.5,
moad_cen_lat=38.5000038147, truelat1=38.5, truelat2=38.5,
pole_lat=90.0, pole_lon=0.0)
projection: LambertConformal(stand_lon=-97.5, moad_cen_lat=38.5000038147,
truelat1=38.5, truelat2=38.5, pole_lat=90.0,
pole_lon=0.0)
vert_interp_type: eth
@ -1122,7 +1088,7 @@ Result: @@ -1122,7 +1088,7 @@ Result:
Coordinates:
* lat_lon (lat_lon) <U3 u'lat' u'lon'
xy_coord object CoordPair(x=400, y=200)
idx int64 0
Dimensions without coordinates: idx
<xarray.DataArray u'xy' (x_y: 2)>
@ -1130,7 +1096,7 @@ Result: @@ -1130,7 +1096,7 @@ Result:
Coordinates:
latlon_coord object CoordPair(lat=28.5581640822, lon=-112.678276173)
* x_y (x_y) <U1 u'x' u'y'
idx int64 0
Dimensions without coordinates: idx
Example With Multiple Coordinates
@ -1163,7 +1129,7 @@ Result: @@ -1163,7 +1129,7 @@ Result:
Coordinates:
* lat_lon (lat_lon) <U3 u'lat' u'lon'
xy_coord (idx) object CoordPair(x=400, y=200) CoordPair(x=105, y=205)
* idx (idx) int64 0 1
Dimensions without coordinates: idx
<xarray.DataArray u'xy' (x_y: 2, idx: 2)>
@ -1172,7 +1138,7 @@ Result: @@ -1172,7 +1138,7 @@ Result:
Coordinates:
latlon_coord (idx) object CoordPair(lat=28.5581640822, lon=-112.678276173) ...
* x_y (x_y) <U1 u'x' u'y'
* idx (idx) int64 0 1
Dimensions without coordinates: idx
Mapping Helper Routines

22
doc/source/index.rst

@ -3,15 +3,28 @@ @@ -3,15 +3,28 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. meta::
:description: Diagnostic and interpolation routines for WRF ARW data
:keywords: wrf, python, wrf-python, weather research and forecasting,
weather research and forecasting model, model, weather,
numerical weather prediction, model, matplotlib, cartopy,
wrf-arw, arw, ncar, ucar, cisl, ncl, ncar command language,
national center for atmospheric research,
university corporation for atmospheric research,
pynio, pyngl, interpolation
wrf-python
===========
A collection of diagnostic and interpolation routines for use with output from
the Weather Research and Forecasting (WRF-ARW) Model.
wrf-python is a package to help users working with the Weather
Research and Forecasting Model (WRF-ARW) output. wrf-python includes over
thirty diagnostics calculations along with various interpolation routines. When
coupled with either matplotlib or PyNGL, users can create plots like this:
This package provides over 30 diagnostic calculations,
several interpolation routines, and utilities to help with plotting
via cartopy, basemap, or PyNGL. The functionality is similar to what is
provided by the NCL WRF package.
When coupled with either matplotlib or PyNGL, users can create plots like this:
.. image:: _static/images/matthew.png
:scale: 100%
@ -33,7 +46,6 @@ Documentation @@ -33,7 +46,6 @@ Documentation
./license
Indices and tables
==================

11
doc/source/new.rst

@ -30,3 +30,14 @@ v1.0b1 @@ -30,3 +30,14 @@ v1.0b1
to find a workaround before the next release. Windows users should use
Python 2.7 or Python 3.4 for now.
v1.0b2
----------
- Beta release 2.
- xarray 0.9 no longer includes default index dimensions in the coordinate
mappings. This was causing a crash in the routines that cause a reduction
in dimension shape, mainly the interpolation routines. This has been
fixed.
- Documentation updated to show the new output from xarray.

207
doc/source/plot.rst

@ -40,9 +40,9 @@ Plotting a Two-dimensional Field @@ -40,9 +40,9 @@ Plotting a Two-dimensional Field
import cartopy.crs as crs
from cartopy.feature import NaturalEarthFeature
from wrf import (to_np, getvar, smooth2d, get_cartopy, latlon_coords,
cartopy_xlim, cartopy_ylim)
from wrf import to_np, getvar, smooth2d, get_cartopy, cartopy_xlim, cartopy_ylim
# Open the NetCDF file
ncfile = Dataset("wrfout_d01_2016-10-07_00_00_00")
# Get the sea level pressure
@ -51,16 +51,15 @@ Plotting a Two-dimensional Field @@ -51,16 +51,15 @@ Plotting a Two-dimensional Field
# Smooth the sea level pressure since it tends to be noisy near the mountains
smooth_slp = smooth2d(slp, 3)
# Get the latitude and longitude coordinate arrays
lats, lons = latlon_coords(smooth_slp)
# The WrfProj.cartopy() method returns a cartopy.crs projection object
cart_proj = get_cartopy(smooth_slp)
# Get the latitude and longitude points
lats, lons = latlon_coords(slp)
# Create a figure that's 10x10
fig = plt.figure(figsize=(10,10))
# Get the cartopy mapping object
cart_proj = get_cartopy(slp)
# Get the GeoAxes set to the projection used by WRF
# Create a figure
fig = plt.figure(figsize=(12,9))
# Set the GeoAxes to the projection used by WRF
ax = plt.axes(projection=cart_proj)
# Download and add the states and coastlines
@ -70,19 +69,18 @@ Plotting a Two-dimensional Field @@ -70,19 +69,18 @@ Plotting a Two-dimensional Field
ax.coastlines('50m', linewidth=0.8)
# Make the contour outlines and filled contours for the smoothed sea level pressure.
plt.contour(to_np(lons), to_np(lats), to_np(smooth_slp), 10, colors="black",
transform=crs.PlateCarree())
plt.contourf(to_np(lons), to_np(lats), to_np(smooth_slp), 10, transform=crs.PlateCarree())
plt.contour(to_np(lons), to_np(lats), to_np(smooth_slp), 10, colors="black", transform=crs.PlateCarree())
plt.contourf(to_np(lons), to_np(lats), to_np(smooth_slp), 10, transform=crs.PlateCarree(), cmap=get_cmap("jet"))
# Add a color bar
plt.colorbar(ax=ax, shrink=.47)
plt.colorbar(ax=ax, shrink=.62)
# Set the map limits
# Set the map limits. Not really necessary, but used for demonstration.
ax.set_xlim(cartopy_xlim(smooth_slp))
ax.set_ylim(cartopy_ylim(smooth_slp))
# Add the gridlines
ax.gridlines()
ax.gridlines(color="black", linestyle="dotted")
plt.title("Sea Level Pressure (hPa)")
@ -104,9 +102,9 @@ Horizontal Interpolation to a Pressure Level @@ -104,9 +102,9 @@ Horizontal Interpolation to a Pressure Level
import cartopy.crs as crs
from cartopy.feature import NaturalEarthFeature
from wrf import (getvar, interplevel, to_np, get_cartopy,
latlon_coords, cartopy_xlim, cartopy_ylim)
from wrf import getvar, interplevel, to_np, latlon_coords, get_cartopy, cartopy_xlim, cartopy_ylim
# Open the NetCDF file
ncfile = Dataset("wrfout_d01_2016-10-07_00_00_00")
# Extract the pressure, geopotential height, and wind variables
@ -125,12 +123,12 @@ Horizontal Interpolation to a Pressure Level @@ -125,12 +123,12 @@ Horizontal Interpolation to a Pressure Level
# Get the lat/lon coordinates
lats, lons = latlon_coords(ht_500)
# Get the cartopy map projection information
# Get the map projection information
cart_proj = get_cartopy(ht_500)
# Create the figure
fig = plt.figure(figsize=(10,10))
ax = plt.axes([0.1,0.1,0.8,0.8], projection=cart_proj)
fig = plt.figure(figsize=(12,9))
ax = plt.axes(projection=cart_proj)
# Download and add the states and coastlines
states = NaturalEarthFeature(category='cultural', scale='50m', facecolor='none',
@ -138,13 +136,13 @@ Horizontal Interpolation to a Pressure Level @@ -138,13 +136,13 @@ Horizontal Interpolation to a Pressure Level
ax.add_feature(states, linewidth=0.5)
ax.coastlines('50m', linewidth=0.8)
# Create the 500 hPa geopotential height contours
# Add the 500 hPa geopotential height contours
levels = np.arange(520., 580., 6.)
contours = plt.contour(to_np(lons), to_np(lats), to_np(ht_500), levels=levels, colors="black",
transform=crs.PlateCarree())
plt.clabel(contours, inline=1, fontsize=10, fmt="%i")
# Wind Speed contours
# Add the wind speed contours
levels = [25, 30, 35, 40, 50, 60, 70, 80, 90, 100, 110, 120]
wspd_contours = plt.contourf(to_np(lons), to_np(lats), to_np(wspd_500), levels=levels,
cmap=get_cmap("rainbow"),
@ -186,19 +184,18 @@ plot, see :ref:`cross_example`. @@ -186,19 +184,18 @@ plot, see :ref:`cross_example`.
import cartopy.feature as cfeature
from netCDF4 import Dataset
from wrf import (getvar, to_np, vertcross, smooth2d, CoordPair, GeoBounds,
latlon_coords, get_cartopy, cartopy_xlim, cartopy_ylim)
from wrf import (getvar, to_np, vertcross, smooth2d, CoordPair, GeoBounds, get_cartopy,
latlon_coords, cartopy_xlim, cartopy_ylim)
# Open the output NetCDF file
filename = "wrfout_d01_2016-10-07_00_00_00"
ncfile = DataSet(filename)
# Open the NetCDF file
ncfile = Dataset("wrfout_d01_2016-10-07_00_00_00")
# Get the WRF variables
slp = getvar(ncfile, "slp")
smooth_slp = smooth2d(slp, 3)
ctt = getvar(ncfile, "ctt")
height = getvar(ncfile, "z")
dbz = getvar(ncfile, "dbz")
z = getvar(ncfile, "z", timeidx=0)
dbz = getvar(ncfile, "dbz", timeidx=0)
Z = 10**(dbz/10.)
wspd = getvar(ncfile, "wspd_wdir", units="kt")[0,:]
@ -206,24 +203,20 @@ plot, see :ref:`cross_example`. @@ -206,24 +203,20 @@ plot, see :ref:`cross_example`.
start_point = CoordPair(lat=26.76, lon=-80.0)
end_point = CoordPair(lat=26.76, lon=-77.8)
# Compute the vertical cross-section interpolation. Also, include the
# lat/lon points along the cross-section in the metadata by setting
# latlon to True.
z_cross = vertcross(Z, height, wrfin=ncfile, start_point=start_point,
end_point=end_point, latlon=True, meta=True)
wspd_cross = vertcross(wspd, height, wrfin=ncfile, start_point=start_point,
end_point=end_point, latlon=True, meta=True)
# Compute the vertical cross-section interpolation. Also, include the lat/lon points along the cross-section
# in the metadata by setting latlon to True.
z_cross = vertcross(Z, z, wrfin=ncfile, start_point=start_point, end_point=end_point, latlon=True, meta=True)
wspd_cross = vertcross(wspd, z, wrfin=ncfile, start_point=start_point, end_point=end_point, latlon=True, meta=True)
dbz_cross = 10.0 * np.log10(z_cross)
# Get the latitude and longitude coordinate arrays
# Get the lat/lon points
lats, lons = latlon_coords(slp)
# Get the cartopy projection object
cart_proj = get_cartopy(slp)
# Create the figure which will have 3 subplots, one on the left, and
# two vertically stacked on the right.
fig = plt.figure(figsize=(7,5))
# Create a figure that will have 3 subplots
fig = plt.figure(figsize=(10,7))
ax_ctt = fig.add_subplot(1,2,1,projection=cart_proj)
ax_wspd = fig.add_subplot(2,2,2)
ax_dbz = fig.add_subplot(2,2,4)
@ -236,23 +229,21 @@ plot, see :ref:`cross_example`. @@ -236,23 +229,21 @@ plot, see :ref:`cross_example`.
ocean = cfeature.NaturalEarthFeature(category='physical', name='ocean', scale='50m',
facecolor=cfeature.COLORS['water'])
# Make the ctt contours.
# Make the pressure contours
contour_levels = [960, 965, 970, 975, 980, 990]
c1 = ax_ctt.contour(to_np(lons), to_np(lats), to_np(smooth_slp), levels=contour_levels,
colors="white", transform=crs.PlateCarree(), zorder=3, linewidths=1.0)
c1 = ax_ctt.contour(lons, lats, to_np(smooth_slp), levels=contour_levels, colors="white",
transform=crs.PlateCarree(), zorder=3, linewidths=1.0)
# Create the filled cloud top temperature contours
contour_levels = [-80.0, -70.0, -60, -50, -40, -30, -20, -10, 0, 10]
ctt_contours = ax_ctt.contourf(lons, lats, to_np(ctt), contour_levels,
cmap=get_cmap("Greys"), transform=crs.PlateCarree(),
zorder=2)
ctt_contours = ax_ctt.contourf(to_np(lons), to_np(lats), to_np(ctt), contour_levels, cmap=get_cmap("Greys"),
transform=crs.PlateCarree(), zorder=2)
# Draw the yellow cross section line
ax_ctt.plot([start_point.lon, end_point.lon], [start_point.lat, end_point.lat],
color="yellow", marker="o", transform=crs.PlateCarree(), zorder=3)
ax_ctt.plot([start_point.lon, end_point.lon], [start_point.lat, end_point.lat], color="yellow",
marker="o", transform=crs.PlateCarree(), zorder=3)
# Create the label bar for cloud top temperature
cb_ctt = fig.colorbar(ctt_contours, ax=ax_ctt, shrink=.5)
# Create the color bar for cloud top temperature
cb_ctt = fig.colorbar(ctt_contours, ax=ax_ctt, shrink=.60)
cb_ctt.ax.tick_params(labelsize=5)
# Draw the oceans, land, and states
@ -265,21 +256,21 @@ plot, see :ref:`cross_example`. @@ -265,21 +256,21 @@ plot, see :ref:`cross_example`.
CoordPair(lat=30.0, lon=-72.0))
ax_ctt.set_xlim(cartopy_xlim(ctt, geobounds=hur_bounds))
ax_ctt.set_ylim(cartopy_ylim(ctt, geobounds=hur_bounds))
ax_ctt.gridlines()
ax_ctt.gridlines(color="white", linestyle="dotted")
# Make the contour plot for wspd
wspd_contours = ax_wspd.contourf(to_np(wspd_cross))
# Make the contour plot for wind speed
wspd_contours = ax_wspd.contourf(to_np(wspd_cross), cmap=get_cmap("jet"))
# Add the color bar
cb_wspd = fig.colorbar(wspd_contours, ax=ax_wspd)
cb_wspd.ax.tick_params(labelsize=5)
# Make the contour plot for dbz
levels = [5 + 5*n for n in range(15)]
dbz_contours = ax_dbz.contourf(to_np(dbz_cross), levels=levels)
dbz_contours = ax_dbz.contourf(to_np(dbz_cross), levels=levels, cmap=get_cmap("jet"))
cb_dbz = fig.colorbar(dbz_contours, ax=ax_dbz)
cb_dbz.ax.tick_params(labelsize=5)
# Set the x-ticks to use latitude and longitude labels.
# Set the x-ticks to use latitude and longitude labels
coord_pairs = to_np(dbz_cross.coords["xy_loc"])
x_ticks = np.arange(coord_pairs.shape[0])
x_labels = [pair.latlon_str() for pair in to_np(coord_pairs)]
@ -288,7 +279,7 @@ plot, see :ref:`cross_example`. @@ -288,7 +279,7 @@ plot, see :ref:`cross_example`.
ax_dbz.set_xticks(x_ticks[::20])
ax_dbz.set_xticklabels(x_labels[::20], rotation=45, fontsize=4)
# Set the y-ticks to be height.
# Set the y-ticks to be height
vert_vals = to_np(dbz_cross.coords["vertical"])
v_ticks = np.arange(vert_vals.shape[0])
ax_wspd.set_yticks(v_ticks[::20])
@ -301,7 +292,7 @@ plot, see :ref:`cross_example`. @@ -301,7 +292,7 @@ plot, see :ref:`cross_example`.
ax_wspd.set_ylabel("Height (m)", fontsize=5)
ax_dbz.set_ylabel("Height (m)", fontsize=5)
# Add titles
# Add a title
ax_ctt.set_title("Cloud Top Temperature (degC)", {"fontsize" : 7})
ax_wspd.set_title("Cross-Section of Wind Speed (kt)", {"fontsize" : 7})
ax_dbz.set_title("Cross-Section of Reflectivity (dBZ)", {"fontsize" : 7})
@ -333,25 +324,27 @@ Plotting a Two-Dimensional Field @@ -333,25 +324,27 @@ Plotting a Two-Dimensional Field
from matplotlib.cm import get_cmap
from mpl_toolkits.basemap import Basemap
from wrf import to_np, getvar, smooth2d, latlon_coords, get_basemap
from wrf import to_np, getvar, smooth2d, get_basemap, latlon_coords
# Open the NetCDF file
ncfile = Dataset("wrfout_d01_2016-10-07_00_00_00")
# Get the sea level pressure
slp = getvar(ncfile, "slp")
# Smooth the sea level pressure since it tends to be noisey near the mountains
# Smooth the sea level pressure since it tends to be noisy near the mountains
smooth_slp = smooth2d(slp, 3)
# Get the latitude and longitude coordinates
# Get the latitude and longitude points
lats, lons = latlon_coords(slp)
# Get the basemap projection object
# Get the basemap object
bm = get_basemap(slp)
# Create a figure that's 10x10
fig = plt.figure(figsize=(10,10))
# Create a figure
fig = plt.figure(figsize=(12,9))
# Add geographic outlines
bm.drawcoastlines(linewidth=0.25)
bm.drawstates(linewidth=0.25)
bm.drawcountries(linewidth=0.25)
@ -362,12 +355,13 @@ Plotting a Two-Dimensional Field @@ -362,12 +355,13 @@ Plotting a Two-Dimensional Field
# Draw the contours and filled contours
bm.contour(x, y, to_np(smooth_slp), 10, colors="black")
bm.contourf(x, y, to_np(smooth_slp), 10)
bm.contourf(x, y, to_np(smooth_slp), 10, cmap=get_cmap("jet"))
# Add a color bar
plt.colorbar(shrink=.47)
plt.colorbar(shrink=.62)
plt.title("Sea Level Pressure (hPa)")
plt.show()
@ -387,6 +381,7 @@ Horizontal Interpolation to a Pressure Level @@ -387,6 +381,7 @@ Horizontal Interpolation to a Pressure Level
from wrf import getvar, interplevel, to_np, get_basemap, latlon_coords
# Open the NetCDF file
ncfile = Dataset("wrfout_d01_2016-10-07_00_00_00")
# Extract the pressure, geopotential height, and wind variables
@ -405,27 +400,28 @@ Horizontal Interpolation to a Pressure Level @@ -405,27 +400,28 @@ Horizontal Interpolation to a Pressure Level
# Get the lat/lon coordinates
lats, lons = latlon_coords(ht_500)
# Get the basemap projection object
# Get the basemap object
bm = get_basemap(ht_500)
# Create the figure
fig = plt.figure(figsize=(8,8))
ax = plt.axes([0.1,0.1,0.8,0.8])
fig = plt.figure(figsize=(12,9))
ax = plt.axes()
# Get the x and y coordinates
# Convert the lat/lon coordinates to x/y coordinates in the projection space
x, y = bm(to_np(lons), to_np(lats))
# Create the 500 hPa geopotential height contours
# Add the 500 hPa geopotential height contours
levels = np.arange(520., 580., 6.)
contours = bm.contour(x, y, to_np(ht_500), levels=levels, colors="black")
plt.clabel(contours, inline=1, fontsize=10, fmt="%i")
# Wind Speed contours
# Add the wind speed contours
levels = [25, 30, 35, 40, 50, 60, 70, 80, 90, 100, 110, 120]
wspd_contours = bm.contourf(x, y, to_np(wspd_500), levels=levels,
cmap=get_cmap("rainbow"))
plt.colorbar(wspd_contours, ax=ax, orientation="horizontal", pad=.05)
# Add the geographic boundaries
bm.drawcoastlines(linewidth=0.25)
bm.drawstates(linewidth=0.25)
bm.drawcountries(linewidth=0.25)
@ -438,6 +434,7 @@ Horizontal Interpolation to a Pressure Level @@ -438,6 +434,7 @@ Horizontal Interpolation to a Pressure Level
plt.show()
Panel Plots from the Front Page
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -458,9 +455,8 @@ plot, see :ref:`cross_example`. @@ -458,9 +455,8 @@ plot, see :ref:`cross_example`.
from wrf import getvar, to_np, vertcross, smooth2d, CoordPair, get_basemap, latlon_coords
# Open the output NetCDF file
filename = "/Users/ladwig/Documents/wrf_files/wrfout_d01_2016-10-07_00_00_00"
ncfile = Dataset(filename)
# Open the NetCDF file
ncfile = Dataset("wrfout_d01_2016-10-07_00_00_00")
# Get the WRF variables
slp = getvar(ncfile, "slp")
@ -475,29 +471,28 @@ plot, see :ref:`cross_example`. @@ -475,29 +471,28 @@ plot, see :ref:`cross_example`.
start_point = CoordPair(lat=26.76, lon=-80.0)
end_point = CoordPair(lat=26.76, lon=-77.8)
# Compute the vertical cross-section interpolations. Also, include the lat/lon points along the cross-section
# in the metadata by setting latlon to True.
# Compute the vertical cross-section interpolation. Also, include the lat/lon points along the cross-section in
# the metadata by setting latlon to True.
z_cross = vertcross(Z, z, wrfin=ncfile, start_point=start_point, end_point=end_point, latlon=True, meta=True)
wspd_cross = vertcross(wspd, z, wrfin=ncfile, start_point=start_point, end_point=end_point, latlon=True, meta=True)
dbz_cross = 10.0 * np.log10(z_cross)
# Extract the latitude and longitude coordinate arrays
# Get the latitude and longitude points
lats, lons = latlon_coords(slp)
# Create a figure that will have 3 subplots. One on the left,
# two vertically stacked on the right.
fig = plt.figure(figsize=(8,5))
# Create the figure that will have 3 subplots
fig = plt.figure(figsize=(10,7))
ax_ctt = fig.add_subplot(1,2,1)
ax_wspd = fig.add_subplot(2,2,2)
ax_dbz = fig.add_subplot(2,2,4)
# Get the basemap projection class
# Get the basemap object
bm = get_basemap(slp)
# Get the x, y values
# Convert the lat/lon points in to x/y points in the projection space
x, y = bm(to_np(lons), to_np(lats))
# Make the pressure contours.
# Make the pressure contours
contour_levels = [960, 965, 970, 975, 980, 990]
c1 = bm.contour(x, y, to_np(smooth_slp), levels=contour_levels, colors="white",
zorder=3, linewidths=1.0, ax=ax_ctt)
@ -511,12 +506,11 @@ plot, see :ref:`cross_example`. @@ -511,12 +506,11 @@ plot, see :ref:`cross_example`.
bm.plot([point_x[0], point_x[1]], [point_y[0], point_y[1]], color="yellow",
marker="o", zorder=3, ax=ax_ctt)
# Create the label bar for cloud top temperature
cb_ctt = fig.colorbar(ctt_contours, ax=ax_ctt, shrink=.68)
# Create the color bar for cloud top temperature
cb_ctt = fig.colorbar(ctt_contours, ax=ax_ctt, shrink=.60)
cb_ctt.ax.tick_params(labelsize=5)
# Draw the oceans, land, and states. Use the same colors as the cartopy
# example
# Draw the oceans, land, and states
bm.drawcoastlines(linewidth=0.25, ax=ax_ctt)
bm.drawstates(linewidth=0.25, ax=ax_ctt)
bm.drawcountries(linewidth=0.25, ax=ax_ctt)
@ -526,13 +520,12 @@ plot, see :ref:`cross_example`. @@ -526,13 +520,12 @@ plot, see :ref:`cross_example`.
# Draw Parallels
parallels = np.arange(np.amin(lats), 30., 2.5)
bm.drawparallels(parallels, ax=ax_ctt)
bm.drawparallels(parallels, ax=ax_ctt, color="white")
merids = np.arange(-85.0, -72.0, 2.5)
bm.drawmeridians(merids, ax=ax_ctt)
bm.drawmeridians(merids, ax=ax_ctt, color="white")
# Get the x and y coordinate ranges for the cropped region around the
# hurricane
# Crop the image to the hurricane region
x_start, y_start = bm(-85.0, np.amin(lats))
x_end, y_end = bm(-72.0, 30.0)
@ -540,14 +533,14 @@ plot, see :ref:`cross_example`. @@ -540,14 +533,14 @@ plot, see :ref:`cross_example`.
ax_ctt.set_ylim([y_start, y_end])
# Make the contour plot for wspd
wspd_contours = ax_wspd.contourf(to_np(wspd_cross))
wspd_contours = ax_wspd.contourf(to_np(wspd_cross), cmap=get_cmap("jet"))
# Add the color bar
cb_wspd = fig.colorbar(wspd_contours, ax=ax_wspd)
cb_wspd.ax.tick_params(labelsize=5)
# Make the contour plot for dbz
levels = [5 + 5*n for n in range(15)]
dbz_contours = ax_dbz.contourf(to_np(dbz_cross), levels=levels)
dbz_contours = ax_dbz.contourf(to_np(dbz_cross), levels=levels, cmap=get_cmap("jet"))
cb_dbz = fig.colorbar(dbz_contours, ax=ax_dbz)
cb_dbz.ax.tick_params(labelsize=5)
@ -573,7 +566,7 @@ plot, see :ref:`cross_example`. @@ -573,7 +566,7 @@ plot, see :ref:`cross_example`.
ax_wspd.set_ylabel("Height (m)", fontsize=5)
ax_dbz.set_ylabel("Height (m)", fontsize=5)
# Add a title
# Add titles
ax_ctt.set_title("Cloud Top Temperature (degC)", {"fontsize" : 7})
ax_wspd.set_title("Cross-Section of Wind Speed (kt)", {"fontsize" : 7})
ax_dbz.set_title("Cross-Section of Reflectivity (dBZ)", {"fontsize" : 7})
@ -598,34 +591,34 @@ plotted using the standard matplotlib API. @@ -598,34 +591,34 @@ plotted using the standard matplotlib API.
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap
import cartopy.crs as crs
from cartopy.feature import NaturalEarthFeature
from netCDF4 import Dataset
from wrf import to_np, getvar, CoordPair, vertcross
# Open the output NetCDF file with PyNIO
# Open the NetCDF file
filename = "wrfout_d01_2016-10-07_00_00_00"
ncfile = Dataset(filename)
# Extract pressure and model height
# Extract the model height and wind speed
z = getvar(ncfile, "z")
wspd = getvar(ncfile, "uvmet_wspd_wdir", units="kt")[0,:]
# Define the start point and end point for the cross section using
# latitude and longitude coordinates.
# Create the start point and end point for the cross section
start_point = CoordPair(lat=26.76, lon=-80.0)
end_point = CoordPair(lat=26.76, lon=-77.8)
# Compute the vertical cross-section interpolation. Also, include the lat/lon
# points along the cross-section in the metadata by setting latlon to True.
wspd_cross = vertcross(wspd, z, wrfin=ncfile, start_point=start_point,
end_point=end_point, latlon=True, meta=True)
# Compute the vertical cross-section interpolation. Also, include the lat/lon points along the cross-section.
wspd_cross = vertcross(wspd, z, wrfin=ncfile, start_point=start_point, end_point=end_point, latlon=True, meta=True)
# Create the figure
fig = plt.figure(figsize=(10,5))
ax = plt.axes([0.1,0.1,0.8,0.8])
fig = plt.figure(figsize=(12,6))
ax = plt.axes()
# Make the contour plot
wspd_contours = ax.contourf(to_np(wspd_cross))
wspd_contours = ax.contourf(to_np(wspd_cross), cmap=get_cmap("jet"))
# Add the color bar
plt.colorbar(wspd_contours, ax=ax)

2
requirements.txt

@ -1,2 +1,2 @@ @@ -1,2 +1,2 @@
numpy>=1.9.0
numpy>=1.10
wrapt>=1.10

2
setup.py

@ -55,7 +55,7 @@ numpy.distutils.core.setup( @@ -55,7 +55,7 @@ numpy.distutils.core.setup(
"GitHub Repository:\n\n"
"https://github.com/NCAR/wrf-python\n\n"
"Documentation:\n\n"
"https://wrf-python.readthedocs.io\n"),
"https://wrf-python.rtfd.org\n"),
url = "https://github.com/NCAR/wrf-python",
keywords = ["python", "wrf-python", "wrf", "forecast", "model",
"weather research and forecasting", "interpolation",

2
src/wrf/version.py

@ -1,2 +1,2 @@ @@ -1,2 +1,2 @@
__version__ = "1.0b1"
__version__ = "1.0b2"

418
test/ipynb/Doc_Examples.ipynb

File diff suppressed because one or more lines are too long

125
test/ipynb/SLS_Example.ipynb

@ -0,0 +1,125 @@ @@ -0,0 +1,125 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"\n",
"from __future__ import (absolute_import, division, print_function, unicode_literals)\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from matplotlib.cm import get_cmap\n",
"import cartopy.crs as crs\n",
"import cartopy.feature as cfeature\n",
"from netCDF4 import Dataset as nc\n",
"\n",
"from wrf import to_np, getvar, smooth2d\n",
"\n",
"# Open the output NetCDF with netcdf-python\n",
"filename = \"/Users/ladwig/Documents/wrf_files/wrfout_d01_2016-10-07_00_00_00\"\n",
"ncfile = nc(filename)\n",
"\n",
"# Get sea level pressure and cloud top temperature\n",
"slp = getvar(ncfile, \"slp\")\n",
"ctt = getvar(ncfile, \"ctt\")\n",
"\n",
"print (ctt)\n",
"\n",
"# Smooth the SLP\n",
"smooth_slp = smooth2d(slp, 3)\n",
"\n",
"# Extract the latitude and longitude coordinate arrays as regular numpy array instead of xarray.DataArray\n",
"lons = ctt.coords[\"XLONG\"]\n",
"lats = ctt.coords[\"XLAT\"]\n",
"\n",
"# Get the cartopy projection class\n",
"wrf_proj = slp.attrs[\"projection\"]\n",
"cart_proj = wrf_proj.cartopy()\n",
"\n",
"# Create the figure\n",
"fig = plt.figure(figsize=(8,8))\n",
"ax = plt.axes([0.1,0.1,0.8,0.8], projection=cart_proj)\n",
"\n",
"# Download and create the states, land, and oceans using cartopy features\n",
"states = cfeature.NaturalEarthFeature(category='cultural', scale='50m', facecolor='none',\n",
" name='admin_1_states_provinces_shp')\n",
"land = cfeature.NaturalEarthFeature(category='physical', name='land', scale='50m', \n",
" facecolor=cfeature.COLORS['land'])\n",
"ocean = cfeature.NaturalEarthFeature(category='physical', name='ocean', scale='50m', \n",
" facecolor=cfeature.COLORS['water'])\n",
"\n",
"# Make the pressure contours.\n",
"#contour_levels = [960, 962, 965, 967, 970, 975, 980, 985, 990, 995]\n",
"#c1 = plt.contour(lons, lats, to_np(smooth_slp), levels=contour_levels, colors=\"white\", \n",
"# transform=crs.PlateCarree(), zorder=3, linewidth=1.3)\n",
"\n",
"# Add pressure contour labels\n",
"#plt.clabel(c1, contour_levels, inline=True, fmt='%1.1f', fontsize=8)\n",
"\n",
"# Create the filled cloud top temperature contours\n",
"#contour_levels = [-80, -70, -60, -50, -40, -30, -20, -10, 0, 10, 20, 30]\n",
"contour_levels = np.arange(-80.0, 10.0, 10.0)\n",
"plt.contourf(to_np(lons), to_np(lats), to_np(ctt), contour_levels, cmap=get_cmap(\"Greys\"),\n",
" transform=crs.PlateCarree(), zorder=2)\n",
"\n",
"# Create the label bar for cloud top temperature\n",
"cb2 = plt.colorbar(ax=ax, shrink=.80)\n",
"\n",
"# Draw the oceans, land, and states\n",
"ax.add_feature(ocean)\n",
"ax.add_feature(land)\n",
"ax.add_feature(states, linewidth=.5, edgecolor=\"black\")\n",
"\n",
"# Crop the domain to the region around the hurricane\n",
"ax.set_extent([-85., -75.0, np.amin(lats), 30.0], crs=crs.PlateCarree())\n",
"# Set the map limits\n",
"#ax.set_xlim(wrf_proj.cartopy_xlim())\n",
"#ax.set_ylim(wrf_proj.cartopy_ylim())\n",
"\n",
"ax.gridlines(crs=crs.PlateCarree(), draw_labels=False)\n",
"\n",
"# Add the title and show the image\n",
"#plt.title(\"Hurricane Matthew Cloud Top Temperature (degC) and Sea Level Pressure (hPa)\")\n",
"#plt.title(\"Hurricane Matthew Cloud Top Temperature (degC)\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 1
}

19
test/ipynb/WRF_Workshop_Demo.ipynb

@ -69,7 +69,7 @@ @@ -69,7 +69,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"collapsed": true
},
@ -81,24 +81,11 @@ @@ -81,24 +81,11 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [
{
"ename": "NIOError",
"evalue": "Unable to open file",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNIOError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-2-9e6cb63ecf8c>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0mfilename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"wrfout_d01_2010-06-13_21-00-00\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0mpynio_filename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfilename\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m\".nc\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 9\u001b[0;31m \u001b[0mncfile\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mopen_file\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpynio_filename\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 10\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 11\u001b[0m \u001b[0;31m# Alternative using netCDF4-python (for reference)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/Users/ladwig/miniconda2/lib/python2.7/site-packages/PyNIO/Nio.pyc\u001b[0m in \u001b[0;36mopen_file\u001b[0;34m(filename, mode, options, history, format)\u001b[0m\n\u001b[1;32m 733\u001b[0m \u001b[0mmask_above_value\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_get_option_value\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moptions\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0m_Nio\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0moption_defaults\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'MaskAboveValue'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 734\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 735\u001b[0;31m \u001b[0mfile\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_Nio\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mopen_file\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mmode\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0moptions\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mhistory\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 736\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 737\u001b[0m \u001b[0mfile_proxy\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_proxy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfile\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'str'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m__del__\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0m__del__\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mcreate_variable\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcreate_variable\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mcreate_group\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcreate_group\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mclose\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mclose\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNIOError\u001b[0m: Unable to open file"
]
}
],
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",

18834
test/ipynb/WRF_python_demo.ipynb

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save