<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body vlink="#551A8B" text="#000000" link="#0B6CDA" bgcolor="#ffffff"
alink="#EE0000">
HI Mateus,<br>
<br>
you can use xarray already you have to add .values to the
sfXArray/sfYArray resources.<br>
<br>
<font color="#3333ff"><tt>lat = xr.open_dataset('your_file').lat</tt><tt><br>
</tt><tt>lon = xr.open_dataset('your_file').lon</tt><tt><br>
</tt><tt>...</tt><tt><br>
</tt><tt>res.sfXArray = lon.values</tt><tt><br>
</tt><tt>res.sfYArray = lat.values</tt></font><br>
<br>
lon.values will give you the xarray data array lon as a numpy array.
<br>
See also
xarray.pydata.org/en/stable/generated/xarray.DataArray.values.html<br>
<br>
Bye<br>
Karin<br>
<br>
<div class="moz-cite-prefix">Am 27.03.19 um 14:14 schrieb Mateus da
Silva Teixeira via pyngl-talk:<br>
</div>
<blockquote type="cite"
cite="mid:CAMJ7i15RtuKF+XcTjrB2miwSRE0AA1yyiOAwTDnK0LhCR5Ub=A@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>I'm beginning to use Python since the news about NCL is
being placed in maintenance mode, and since it was said that
PyNIO will also be placed in maintenance mode, I'm using other
libraries to open data files and PyNGL for graphics.</div>
<div><br>
</div>
<div>Reading about Ngl.contour_map(), I found that it expects a
numpy array with data to plot and coordinates information are
given to sfXArray and sfYArray resources.</div>
<div><br>
</div>
<div>Is there a plan to use xarray.DataArray as a data model for
PyNGL? It has large similarities with NCL's variable model,
which is borrowed from netCDF model.</div>
<div><br>
</div>
<div>I'm asking it because it seems more natural to use xarray,
which contains all metadata for a variable, than use a numpy
array.</div>
<div><br>
</div>
<div>Thanks and excuse me if it's a already defined topic in
future development of PyNGL.</div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>Mateus</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/pyngl-talk">http://mailman.ucar.edu/mailman/listinfo/pyngl-talk</a>
</pre>
</blockquote>
<br>
</body>
</html>