1

I am encountering an error in MetPy when following the geocolor satellite imagery tutorial. Specifically, the section entitled "Plot with Cartopy Geostationary Projection". This breakage occurred roughly two weeks ago and functionality has yet to return. Consider the following code:

from xarray import open_dataset  
import metpy

data_dir = '.'  
color_file = 'OR_ABI-L1b-RadC-M3C01_G16_s20180152002235_e20180152005008_c20180152005054.nc'  
c = open_dataset('/'.join([data_dir,color_file]))  
dat = c.metpy.parse_cf('Rad')

This block is functionally similar to that provided in the MetPy geocolor satellite tutorial. It worked fine until recently. Now the following error occurs:

Traceback (most recent call last):  
  File "<stdin>", line 1, in module  
  File "/usr/local/anaconda3/lib/python3.7/site-packages/metpy/xarray.py", line 191, in parse_cf  
    from .plots.mapping import CFProjection  
  File "/usr/local/anaconda3/lib/python3.7/site-packages/metpy/plots/__init__.py", line 13, in module  
    from .skewt import *  # noqa: F403  
  File "/usr/local/anaconda3/lib/python3.7/site-packages/metpy/plots/skewt.py", line 28, in module  
    from ..calc import dewpoint, dry_lapse, moist_lapse, vapor_pressure  
  File "/usr/local/anaconda3/lib/python3.7/site-packages/metpy/calc/__init__.py", line 7, in module  
    from .cross_sections import *  # noqa: F403  
  File "/usr/local/anaconda3/lib/python3.7/site-packages/metpy/calc/cross_sections.py", line 14, in module  
    from .tools import first_derivative  
  File "/usr/local/anaconda3/lib/python3.7/site-packages/metpy/calc/tools.py", line 101, in module  
    def find_intersections(x, a, b, direction='all'):  
  File "/usr/local/anaconda3/lib/python3.7/site-packages/pint/registry_helpers.py", line 248, in decorator  
    % (func.__name__, count_params, len(args))  
TypeError: find_intersections takes 4 parameters, but 3 units were passed

What seems to be the problem here? Is there a workaround available?

Gilfoyle
  • 3,282
  • 3
  • 47
  • 83
jlave
  • 226
  • 3
  • 7

1 Answers1

0

I think it's an incompatibility between your installed versions of MetPy and Pint. Try making sure you're running the latest versions of those two with:

conda update metpy pint

I should note that MetPy 0.12.0 (currently the latest) is incompatible with xarray 0.15.1. As of this writing, if the above command updates xarray, you'll need to roll it back slightly with:

conda install xarray=0.15.0

We're working on a bugfix release to address this.

DopplerShift
  • 5,472
  • 1
  • 21
  • 20