[pyngl-talk] Function similar to NCL's nggcog?
alyssa.stansfield at stonybrook.edu
Fri Oct 19 10:54:13 MDT 2018
Wow, thank you so much for this!
On Fri, Oct 19, 2018 at 12:33 PM Mary Haley <haley at ucar.edu> wrote:
> Hi Alyssa,
> Normally I would suggest googling something like "great circle numpy" and
> you are likely to find a number of functions that calculate the same thing
> as NCL's nggcog.
> However, as an exercise, since I knew the nggcog Fortran routine was
> pretty short, I decided to see what it took to convert it to python. This
> routine calls an internal Fortran routine called ngritd, so I had to
> convert that too.
> I didn't try to do this the "pythonic" way, using array arithmetic instead
> of looping, because doing a line-by-line conversion was simply faster.
> See the attached nggcog.py which defines both nggcog and ngritd and has
> some driver code that generates and plot a great circle. I attached the NCL
> version for comparison. You should be able to run these as-is:
> python nggcog.py
> ncl nggcog.ncl
> I'm in the process of learning how to create Python versions of NCL
> scripts, so this was a good exercise. :-)
> Note: the Python version of the nggcog routine is not tested, other than
> this plotting program. You might want to look at the Fortran code yourself
> to compare it with the Python code.
> The Fortran routines can be found on github:
> and then navigate down to this path:
> and the nggcog.f and ngridt.f Fortran code can be found on that page:
> On Wed, Oct 17, 2018 at 7:29 PM, Alyssa Stansfield via pyngl-talk <
> pyngl-talk at ucar.edu> wrote:
>> I am trying to plot a circle with a radius of 200 km around a certain
>> latitude and longitude on a map. I know that NCL has the nggcog command,
>> but does pyngl have anything similar? Or do you know of a workaround using
>> pyngl commands?
>> Thank you,
>> pyngl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pyngl-talk