[ncl-talk] NCL to Python
John Clyne
clyne at ucar.edu
Mon Apr 27 13:58:12 MDT 2020
Hi Damianos, Jared,
Let me provide some additional information on the NCL transition to Python, specifically with regard to PyNGL, PyNIO, and wrf-Python:
1. PyNIO is in maintenance mode. We will no longer add new features to it. We encourage the use of Xarray for reading and writing various scientific file formats. If there are important capabilities that are missing from Xarray we would like to hear about them so that we can make plans to address these deficiencies.
2. PyNGL is still under evaluation for its continued development. However, we are actively exploring Matplotlib (and other Python ecosystem tools) as a replacement for PyNGL. We recently constructed a gallery of example plots that show how many NCL plots can easily be created with Matplotlib. The gallery is available here:
https://geocat-examples.readthedocs.io/en/latest/
We encourage the user community to provide feedback and suggest new plots.
3. wrf-Python is still under development. We will continue to add capabilities to this package in response to community needs.
For the most recent information on this transition and new community software being developed at NCAR - now known as the Geoscience Community Analysis Toolkit (GeoCAT) - we encourage you to visit the web site:
www.geocat.ucar.edu
We look forward to hearing from you.
The GeoCAT Team
> Date: Fri, 24 Apr 2020 09:53:57 -0600
> From: Jared Lee <jaredlee at ucar.edu>
> To: Damianos Mantsis <dmantsis at gmail.com>
> Cc: NCL-talk <ncl-talk at ucar.edu>
> Subject: Re: [ncl-talk] NCL to Python
> Message-ID:
> <CAFMTitctA2w90UqWyWZXU5CX19L-D192mtzOvAC-JH7k6fbMDQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Damianos,
>
> I've been translating a number of my scripts from NCL to Python, and now
> all my new development is in Python. When dealing with WRF output, if you
> want to use the WRF-Python functions, you'll need to import these modules:
>
> import wrf
> import netCDF4
>
> And if you want to use PyNGL to make NCL-style plots:
>
> import Ngl
>
> PyNIO isn't being updated anymore, but it still has a lot of readers for
> numerous current geophysical data formats (grib, netcdf, hdf, etc.). I try
> to use xarray as much as I can, but there are some things for which netCDF4
> or PyNIO work more smoothly (for instance, netCDF4 is simpler than xarray
> for converting character arrays to strings, in my experience, and PyNIO
> could read a grib output file straightforwardly, while with xarray you need
> additional packages called cfgrib and ecCodes):
>
> import Nio
> import xarray
>
> While I still use PyNGL for making map-style plots from my gridded model
> output, I've switched to using Matplotlib for other plots, including line
> plots and box plots, because I think they look nicer than NCL/PyNGL:
>
> import matplotlib
>
> Some other really common modules for data analysis that you'll want to use
> include:
>
> import numpy
> import pandas
> import datetime
> import pytz (for explicit time zone conversion and handling)
>
> Karin Meier-Fleischer of DKRZ has a helpful NCL to Python transition guide,
> with side by side examples of how to do quite a few things in both
> languages. I found this quite helpful for me initially as I was just
> getting my feet wet with Python, coming from an NCL framework:
>
> https://www.ncl.ucar.edu/Applications/NCL_to_Python/
>
> I hope that all helps. It's been a slow learning process for me, but I'm
> fairly comfortable with Python now. There are lots of resources available
> on the web for Python, such as StackOverflow, etc., and numerous "beginning
> Python" tutorials for free viewing/download to get started with
> basics. Good luck!
>
> Jared
>
>
> On Fri, Apr 24, 2020 at 2:27 AM Damianos Mantsis via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
>> Hi everyone
>>
>> I have a question about the transition from NCL to Python. I need to
>> transition to the NCL related Pyhon modules, that have been developed by
>> the NCAR team given the fact that NCL will not be further developed.
>>
>> My question is about the use of PyNGL, PyNIO, WRF-Python modules. Which of
>> these need to be installed with Python. Some of these are interdependent
>> and I got a little confused, and one might contain the other. If you are
>> not familiar with the topic please suggest someone that has done this
>> transition (NCL to Python). any help would be greatly appreciated.
>>
>> Thank you
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> --
>
>
> *My working day may not be your working day.Please do not feel obligated to
> reply to this email outside of your normal working day.*
>
> ===============================
> Jared A. Lee, Ph.D.
> Project Scientist II
> Research Applications Laboratory
> National Center for Atmospheric Research
> Boulder, Colorado, USA
>
> Member, AMS Planning Commission
>
> Email: jaredlee at ucar.edu (w)
> Phone: 303.497.8485 (w)
> Web: https://staff.ucar.edu/users/jaredlee
> ===============================
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200424/629c1c0e/attachment-0001.html>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> ------------------------------
>
> End of ncl-talk Digest, Vol 197, Issue 24
> *****************************************
John Clyne
National Center for Atmospheric Research
303.497.1236 (w), 303.809.1922 (c)
clyne at ucar.edu
More information about the ncl-talk
mailing list