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

[python #GHH-540116]: QG Analysis code ERROR



Greetings!

It seems that the GitHub rendering of the notebook may be having problems. Try 
using this link and saving the page as a "QGAnalysis.ipynb" and then opening it:

https://gist.githubusercontent.com/dcamron/84dee25ab2ce81b24624e919186df581/raw/8a08a038e6968fdabaf192199201d6f516f8aaaf/QG%2520Analysis.ipynb

Ryan

> Dear Drew,
> I can not read the ipynb in your github. This file seems to be wrong.
> Best wishes,
> Yuheng
> 
> 
> > -----????-----
> &gt; ???: "Unidata Python Support" <address@hidden>
> &gt; ????: 2021-08-18 05:27:01 (???)
> &gt; ???: address@hidden
> &gt; ??: address@hidden
> &gt; ??: [python #GHH-540116]: QG Analysis code ERROR
> &gt;
> &gt; Hello! Thanks for reaching out.
> &gt;
> &gt; We are currently in the process of revamping our collection of workshop 
> materials, as well as how the website presents these materials. So for the 
> moment, this particular notebook is out of date for newer versions of MetPy! 
> As of version 1.0 and onward we changed the function signatures for a few of 
> our kinematic calculations 
> (https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.html#dynamic-kinematic),
>  particularly advection and vorticity. Check out the documentation to see the 
> specifics of how these have changed. Here are what these specific lines would 
> look like,
> &gt;
> &gt;   # Absolute Vorticity Calculation
> &gt;   avor_900 = mpcalc.absolute_vorticity(uwnd_900s, vwnd_900s, dx=dx, 
> dy=dy, latitude=lats)
> &gt;   avor_500 = mpcalc.absolute_vorticity(uwnd_500s, vwnd_500s, dx=dx, 
> dy=dy, latitude=lats)
> &gt;
> &gt;   # Advection of Absolute Vorticity
> &gt;   vortadv_900 = mpcalc.advection(avor_900, uwnd_900s, vwnd_900s, dx=dx, 
> dy=dy).to_base_units()
> &gt;   vortadv_500 = mpcalc.advection(avor_500, uwnd_500s, vwnd_500s, dx=dx, 
> dy=dy).to_base_units()
> &gt;
> &gt; and here is a link to a fully executed version of this notebook with 
> some of the necessary changes in place: 
> https://gist.github.com/dcamron/84dee25ab2ce81b24624e919186df581
> &gt;
> &gt; There are a few other ways this notebook can be trimmed down with help 
> of our new xarray-focused capabilities, but this should be enough to get it 
> working as-is. Hope this helps, and look forward to these workshop materials 
> being updated soon! Let me know if there's any further way I can help.
> &gt;
> &gt;
> &gt; All the best,
> &gt;
> &gt; Drew
> &gt;
> &gt;
> &gt; &gt; When I use the codes in this page 
> (https://unidata.github.io/python-training/workshop/MetPy_Advanced/qg-analysis/#interpolation),
>  I always got an error ValueError: Must provide dx, dy, and/or dz arguments 
> or input DataArray with proper coordinates in this line (vortadv_900 = 
> mpcalc.advection(avor_900, (uwnd_900s, vwnd_900s), (dx, 
> dy)).to_base_units()). I did not modify any code in this ipynb file. Before 
> this error line, I can got all correct outputs. Could you give some advice?
> &gt; &gt;
> &gt;
> &gt;
> &gt; Ticket Details
> &gt; ===================
> &gt; Ticket ID: GHH-540116
> &gt; Department: Support Python
> &gt; Priority: Low
> &gt; Status: Closed
> &gt; ===================
> &gt; 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.
> &gt;
> </address@hidden>


Ticket Details
===================
Ticket ID: GHH-540116
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.