[pyngl-talk] reading wrf output without lat lon variables

Bill Ladwig ladwig at ucar.edu
Mon Oct 29 10:40:06 MDT 2018

Hi Huseyin,

Without that information in the files, you're going to have to calculate
the latitude and longitude values. Since you're using Python, you can use
wrf-python which contains a xy_to_ll routine that converts grid points to
latitude and longitude points, as long as you're using one of the standard
WRF projections, which it looks like you are (

Note that this will only work if you have the map projection global
parameters still in your file. If not, there is an xy_to_ll_proj version
where you can specify the parameters yourself. (

Hope this helps,


On Mon, Oct 29, 2018 at 7:17 AM Huseyin Ozdemir via pyngl-talk <
pyngl-talk at ucar.edu> wrote:

> Hi everyone,
> I have a problem with reading wrf output file (Projection is Polar
> Stereographic); i want to compare wrf model output with observations at
> specific latitude-longitude coordinates, but output netcdf file has no
> latitude and longitude variables.
> I am using my python environment for reading this netcdf file, where PyNGL
> and PyNIO are already installed. As an example, temp variable in this
> output has attributes below:
> short T2 [ Time|1, south_north|150, west_east|150 ]
>       FieldType : 104
>       MemoryOrder : XY
>       description : TEMP at 2 M
>       units : K
>       stagger :
>       coordinates : XLONG XLAT XTIME
>       add_offset : 273.8086
>       scale_factor : -0.0005068767
> Here, T2 variable has “Time", “south_north" and “west_east” dimensions and
> “south_north" and "west _east" dimensions have both 150 grids.  There is no
> XLAT and XLONG variables in the netcdf output, so how can i get the
> temperatures at any lat-lon points with just grid numbers?
> Thanks in advance,
> Huseyin
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20181029/50997ef7/attachment.html>

More information about the pyngl-talk mailing list