<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Dave, <br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thank you for your answer.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I'm just making plots at the moment.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Athansios<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="Signature">
<pre>Athanasios F. Karagiannidis<br>Physicist, PhD Meteorology and Climatology<br>E-mail: thankar@live.com</pre>
</div>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> Dave Allured - NOAA Affiliate <dave.allured@noaa.gov><br>
<b>Sent:</b> Tuesday, March 27, 2018 7:58 PM<br>
<b>To:</b> Athanasios Karagiannidis<br>
<b>Cc:</b> ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] Assign 2d Lat Lon matrices as coordinates to a 2d variable matrix</font>
<div> </div>
</div>
<div>
<div dir="ltr">Athanasios,
<div><br>
</div>
<div>For plotting fields with 2-D coordinate arrays, use one of these two methods.  Attach the 2-D coordinates directly to the data variable, using these special attribute names:</div>
<div><br>
</div>
<div><font face="monospace, monospace">    FR@lat2d = Lat         ; (2-D)</font></div>
<div><font face="monospace, monospace">    FR@lon2d = Lon         ; (2-D)</font></div>
<div><br>
</div>
<div>Alternatively, attach the 2-D coordinates to the plot resource variable.  The special attribute names are different in this method:</div>
<div><br>
</div>
<div><font face="monospace, monospace">    res@sfYArray = Lat     ; (2-D)</font></div>
<div><font face="monospace, monospace">    res@sfXArray = Lon     ; (2-D)</font></div>
<div><br>
</div>
<div>Please see section 2 on this page for more details and examples:</div>
<div><br>
    <a href="http://www.ncl.ucar.edu/Document/Graphics/overlays_on_map.shtml" id="LPlnk13195" previewremoved="true">
http://www.ncl.ucar.edu/Document/Graphics/overlays_on_map.shtml</a></div>
<div id="LPBorder_GT_15222312585680.6960251556126824" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15222312585640.2785394276149685" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" role="presentation" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td id="TextCell_15222312585640.40394837314533794" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" colspan="2">
<div id="LPRemovePreviewContainer_15222312585640.19000945617413512"></div>
<div id="LPTitle_15222312585640.2330396248948151" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: "wf_segoe-ui_light", "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15222312585660.1965771684916544" style="text-decoration: none;" href="http://www.ncl.ucar.edu/Document/Graphics/overlays_on_map.shtml" target="_blank">NCL Graphics: overlaying data on a map</a></div>
<div id="LPMetadata_15222312585660.40967475214547266" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
www.ncl.ucar.edu</div>
<div id="LPDescription_15222312585680.017897806002561967" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
NCL Home > Documentation > Graphics Overlaying data on a map For some specific examples of plotting data on a map, see the "Plotting data on a map using gsn_csm_xxx ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<div><br>
</div>
<div>There are many other examples on this page, listed directly under the names of these special attributes:</div>
<div><br>
</div>
<div>    <a href="http://www.ncl.ucar.edu/Applications/res_list.shtml" id="LPlnk156488" previewremoved="true">http://www.ncl.ucar.edu/Applications/res_list.shtml</a></div>
<div><br>
</div>
<div>
<div>There is a different convention for writing self-contained Netcdf files to share with other people.  Are you writing files, or just making plots?</div>
<div><br>
</div>
<div>--Dave</div>
<div><br>
</div>
<div><br>
<div class="x_gmail_extra">
<div class="x_gmail_quote">On Tue, Mar 27, 2018 at 10:42 AM, Athanasios Karagiannidis
<span dir="ltr"><<a href="mailto:thankar@live.com" target="_blank" id="LPlnk987368" previewremoved="true">thankar@live.com</a>></span> wrote:<br>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-style:solid; border-left-color:rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div id="x_gmail-m_2841551994089040681divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0px; margin-bottom:0px"><span id="x_gmail-m_2841551994089040681ms-rterangepaste-start"></span></p>
<div>
<p class="x_MsoNormal"><span lang="EN-US">Dear all</span></p>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
<p class="x_MsoNormal"><span lang="EN-US">Could someone help with the following: I have a 2d matrix of a variable (let’s call it FR), extracted from an hdf5 file. I get a 2d Lat matrix and a 2d Lon matrix from 2 other files. How can I assign these Lat and Lon
 matrices as dimensions for FR? I need to point out here, that the grid in not regular.</span></p>
<p class="x_MsoNormal"><span lang="EN-US">I already thought about transforming FR, Lat, and Lon to a 1d matrices, and combining them to a single matrix with Lat, Lon and FR as the first, second and third column respectively. But I think it would be more elegant,
 and less resource-consuming if I could just assign the Lat Lon matrices as coordinates to FR matrix.</span></p>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
<p class="x_MsoNormal"><span lang="EN-US">Thank you in advance</span></p>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
<p class="x_MsoNormal"><span lang="EN-US">Athanasios Karagiannidis</span></p>
</div>
<div id="x_gmail-m_2841551994089040681Signature">
<pre>Athanasios F. Karagiannidis<br>Physicist, PhD Meteorology and Climatology<br>E-mail: <a href="mailto:thankar@live.com" target="_blank" id="LPlnk336037" previewremoved="true">thankar@live.com</a></pre>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>