[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[python #WMX-664910]: Error: Neither Quantity object nor its magnitude supports indexing



Hi,

I'm glad you've found MetPy, and sorry you've run into problems.

We recently released MetPy 0.10.2 that should solve problems like this. I just 
tried running the example with my environment with the latest versions of MetPy 
(0.10.2) and Pint (0.9) and everything worked for me locally. Can you try 
updating your version of MetPy and see if that fixes your problem?

If that doesn't solve it, can you send me the output of: conda list

Thanks!

Ryan

> Hi,
> 
> Thanks a lot for your very useful metpy module.
> 
> I am trying to calculate temperature advection using this example:
> 
> https://unidata.github.io/python-gallery/examples/850hPa_Temperature_Advection.html
> 
> But I have an error in this line:
> 
> adv = mpcalc.advection(temp_850 * units.kelvin, [u_wind_850,
> v_wind_850],(dx, dy), dim_order='yx') * units('K/sec')
> 
> AttributeError: Neither Quantity object nor its magnitude supports
> indexing (see screenshot).
> 
> Temp_850, u_wind_850 and v_wind_850 all have shape (91,89). I do not
> have access to the NCSS module that you used in the example so I cannot
> test with that data.
> 
> Any advice you have on solving this would be much appreciated!

Ticket Details
===================
Ticket ID: WMX-664910
Department: Support Python
Priority: Low
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.