Skip to content

AttributeError: vertical attribute is not available. #3160

Answered by dcamron
tik619 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! The core of the issue is that your vertical coordinate (here lev and level in some of your examples) is not compliant with CF conventions. MetPy tries to understand relevant metadata and even match common names, but we your coordinates are lacking any metadata and we don't currently check for "lev" or "level" (@jthielen should we?).

You were on the right track by specifying parse_cf(coordinates = {'Z': 'level'}) in your earlier example, but the MetPy internal coordinate identifier is 'vertical', not 'Z' (an alias we could consider adding.) You are also missing unit information. The following should work with your data with those two fixes:

import xarray as xr
import metpy.calc as mpcalc

Replies: 6 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dopplershift
Comment options

Comment options

You must be logged in to vote
1 reply
@dopplershift
Comment options

Comment options

You must be logged in to vote
2 replies
@dopplershift
Comment options

@tik619
Comment options

Comment options

You must be logged in to vote
1 reply
@dcamron
Comment options

Answer selected by dcamron
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants