<div dir="ltr"><div class="gmail_default"><font face="arial, helvetica, sans-serif">Hi Muhammad,</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">To answer your first question about what the "mask" lines are doing:</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">The way a mask array works is that you have two 2D arrays of the exact same size, where one array is an array of some values, say temperature, and the other is an array of 0s and 1s. We call this second array a "mask array".</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">When you call the "mask" function like this, using the data array and the mask array:</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)"> tc2_mask = mask(tc2,marray,1)</span><br></font></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br></font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">you are effectively telling NCL, "At the locations where marray is equal to 1, return the corresponding value in tc2, and otherwise return a missing value." </font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br></font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">What you get back, then, is an array of the same size as tc2, but with some of its values set to missing ( tc2@_FillValue ).</font></span></div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small">The best way to understand how mask works is to try it out on a small "dummy" array. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Here's a script that creates a simple 4 x 3 dummy array called "t2", and a mask array called "marray". It masks the t2 array in two different ways, and prints the values in a nice format so you can see what's going on:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace"> t2 = (/(/1,2,3/),(/4,5,6/),(/7,8,9/<wbr>),(/10,11,12/)/)</font></div><div class="gmail_default"><font face="monospace, monospace"> t2@_FillValue = -999</font></div><div class="gmail_default"><font face="monospace, monospace"> marray = (/(/1,0,0/),(/0,1,0/),(/1,1,1/<wbr>),(/0,0,1/)/)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"> m1 = mask(t2,marray,1)</font></div><div class="gmail_default"><font face="monospace, monospace"> m0 = mask(t2,marray,0)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"> opt = True</font></div><div class="gmail_default"><font face="monospace, monospace"> opt@title = "t2"</font></div><div class="gmail_default"><font face="monospace, monospace"> write_matrix (t2, ("3i6"),opt)</font></div><div class="gmail_default"><font face="monospace, monospace"> opt@title = "marray"</font></div><div class="gmail_default"><font face="monospace, monospace"> write_matrix (marray, ("3i6"),opt)</font></div><div class="gmail_default"><font face="monospace, monospace"> opt@title = "m1"</font></div><div class="gmail_default"><font face="monospace, monospace"> write_matrix (m1, ("3i6"),opt)</font></div><div class="gmail_default"><font face="monospace, monospace"> opt@title = "m0"</font></div><div class="gmail_default"><font face="monospace, monospace"> write_matrix (m0, ("3i6"),opt)</font></div><div class="gmail_default"><br></div><div class="gmail_default">Here's the output:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace"> t2</font></div><div class="gmail_default"><font face="monospace, monospace"> </font></div><div class="gmail_default"><font face="monospace, monospace"> 1 2 3</font></div><div class="gmail_default"><font face="monospace, monospace"> 4 5 6</font></div><div class="gmail_default"><font face="monospace, monospace"> 7 8 9</font></div><div class="gmail_default"><font face="monospace, monospace"> 10 11 12</font></div><div class="gmail_default"><font face="monospace, monospace"> </font></div><div class="gmail_default"><font face="monospace, monospace"> marray</font></div><div class="gmail_default"><font face="monospace, monospace"> </font></div><div class="gmail_default"><font face="monospace, monospace"> 1 0 0</font></div><div class="gmail_default"><font face="monospace, monospace"> 0 1 0</font></div><div class="gmail_default"><font face="monospace, monospace"> 1 1 1</font></div><div class="gmail_default"><font face="monospace, monospace"> 0 0 1</font></div><div class="gmail_default"><font face="monospace, monospace"> </font></div><div class="gmail_default"><font face="monospace, monospace"> m1</font></div><div class="gmail_default"><font face="monospace, monospace"> </font></div><div class="gmail_default"><font face="monospace, monospace"> 1 -999 -999</font></div><div class="gmail_default"><font face="monospace, monospace"> -999 5 -999</font></div><div class="gmail_default"><font face="monospace, monospace"> 7 8 9</font></div><div class="gmail_default"><font face="monospace, monospace"> -999 -999 12</font></div><div class="gmail_default"><font face="monospace, monospace"> </font></div><div class="gmail_default"><font face="monospace, monospace"> m0</font></div><div class="gmail_default"><font face="monospace, monospace"> </font></div><div class="gmail_default"><font face="monospace, monospace"> -999 2 3</font></div><div class="gmail_default"><font face="monospace, monospace"> 4 -999 6</font></div><div class="gmail_default"><font face="monospace, monospace"> -999 -999 -999</font></div><div class="gmail_default"><font face="monospace, monospace"> 10 11 -999</font></div><div class="gmail_default"><font face="monospace, monospace"> </font></div><div><br></div><div><br class="gmail-m_-2487880908988443009gmail-Apple-interchange-newline">I'm not sure what you mean by "<span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif">I need to know how to use the variables in other code." In the script I sent you, I showed how to mask three different variables on the file, using the same mask array. Is this not what you are talking about?</span><br></div><div><span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif"><br></span></div>I created a slightly different script showing how to create the mask, apply the mask to a given set of desired variables, and then how to write the masked variables to a new file. I then wrote a second "wrf_plot_orig_and_masked.ncl" script that plots the original data and masked data.<div><font color="#000000" face="Calibri, Helvetica, sans-serif"><br></font></div><div><font color="#000000" face="Calibri, Helvetica, sans-serif">I'm only doing this because I'm eventually going to make a new mask example out of all this. But again, please, I ask that you look over the code and try to understand it on your own. Use our functions page to look up any functions you don't understand:</font></div><div><font color="#000000" face="Calibri, Helvetica, sans-serif"><br></font></div><div><font color="#000000" face="Calibri, Helvetica, sans-serif"><a href="http://www.ncl.ucar.edu/Document/Functions/list_alpha.shtml">http://www.ncl.ucar.edu/Document/Functions/list_alpha.shtml</a><br></font></div><div><font color="#000000" face="Calibri, Helvetica, sans-serif"><br></font></div><div><font color="#000000" face="Calibri, Helvetica, sans-serif">Use our examples page to look at other masking and/or shapefile examples:</font></div><div><font color="#000000" face="Calibri, Helvetica, sans-serif"><br></font></div><div><font color="#000000" face="Calibri, Helvetica, sans-serif"><a href="http://www.ncl.ucar.edu/Applications/">http://www.ncl.ucar.edu/Applications/</a><br></font></div><div><font color="#000000" face="Calibri, Helvetica, sans-serif"><br></font></div><div><font color="#000000" face="Calibri, Helvetica, sans-serif">--Mary</font></div><div><font color="#000000" face="Calibri, Helvetica, sans-serif"><br></font></div><div><span style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif"><br></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 11, 2017 at 4:59 AM, Muhammad Omer Mughal <span dir="ltr"><<a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu<wbr>.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hi Mary </p>
<p><br>
</p>
<p>Many thanks for the detailed email. I have worked with the code and produced the masked images for the variables which I need to use in my other code . </p>
<p><br>
</p>
<p>However I need to know how to use the variables in other code. </p>
<p><br>
</p>
<p>I have tried to understand the following lines but I am still struggling with it .Will it be possible for you to explain the following lines and how to output these variables to be used in another code. I would be grateful for your help </p>
<p><br>
</p>
<p></p>
<div><br>
</div>
<div> f = addfile("<a href="http://wrf_mask.nc" target="_blank">wrf_mask.nc</a>","r")</div>
<div> marray = f->WRF_mask</div>
<div> tc2_mask = mask(tc2,marray,1)</div>
<div> lu_mask = mask(lu,marray,1)</div>
<div> tc2f_mask = mask(tc2f,marray,1</div>
<br>
<p></p>
<p><br>
</p>
<div id="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171Signature">
<div id="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div style="font-family:Tahoma;font-size:13px"><span class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-">
<div style="font-family:Tahoma;font-size:13px"><b><br>
</b></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial Bold" size="2" color="#1F497D"><span style="font-size:11pt">Muhammad Omer Mughal</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial Bold" size="2" color="#1F497D"><span style="font-size:11pt">MSc BSc Mechanical Engineering</span></font><font face="Arial,sans-serif" size="1" color="#1F497D"><span style="font-size:8pt"><br>
</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">PhD Research Scholar</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Remote Sensing and Satellite Research Group</span></font></span></font></div>
</span><div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><span class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-"><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Department of Imaging and Applied Physics</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt"><br>
Curtin University</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt"><br>
</span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:11pt"><br>
</span></font><font face="Arial Bold" size="2" color="#1F497D"><span style="font-size:9pt">Curtin University</span></font><font face="Arial Bold" size="2" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Tel |</span></font><font face="Arial Bold" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt">+61
8 9266 7962</span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><font face="Calibri,sans-serif" size="1" color="#1F497D"><span style="font-size:7pt"><br>
</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Fax |</span></font><font face="Arial Bold" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt">+61
8 9266 2377</span></font><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Mobile |</span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt">0470 237 525</span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Email |</span></font><font face="Calibri,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><a href="mailto:m.lynch@curtin.edu.au" id="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171LPNoLP" target="_blank"><font face="Arial,sans-serif" size="2"><span style="font-size:9pt">m.mughal1@postgrad.curtin.ed<wbr>u.au</span></font></a><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"> </span></font><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"><br>
</span></font></span><font face="Arial Bold" size="2" color="#AB8303"><span style="font-size:9pt">Web |</span></font><font face="Calibri,sans-serif" size="2" color="#AB8303"><span style="font-size:9pt"> </span></font><a href="http://curtin.edu.au/" id="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171LPNoLP" target="_blank"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font face="Arial,sans-serif" size="2"><span style="font-size:9pt">http://curtin.edu.au</span></font></span></font></a><font face="Arial,sans-serif" size="2" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font face="Calibri,sans-serif" size="1" color="#1F497D"><span style="font-size:7pt"><br>
</span></font></span></font></div><span class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-">
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Calibri,sans-serif" size="1" color="#1F497D"><span style="font-size:6pt"></span></font><font face="Arial,sans-serif" size="1" color="#1F497D"><span style="font-size:6pt">Curtin University is a trademark of Curtin University of Technology. </span></font><br>
</div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial,sans-serif" size="1" color="#1F497D"><span style="font-size:6pt">CRICOS Provider Code 00301J (WA), 02637B (NSW)</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial,sans-serif" size="1" color="#1F497D"><span style="font-size:6pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;font-size:15.4545px;margin:0px;background-color:rgb(255,255,255)">
<font face="Times New Roman,serif" size="3"><span style="font-size:12pt"><font face="Arial,sans-serif" size="1" color="#1F497D"><span style="font-size:6pt"><br>
</span></font></span></font></div>
</span></div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Mary Haley <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>><br>
<b>Sent:</b> Friday, 10 November 2017 4:28:25 AM<div><div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-h5"><br>
<b>To:</b> Muhammad Omer Mughal<br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] Masking</div></div></font>
<div> </div>
</div><div><div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-h5">
<div>
<div dir="ltr">
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default" style="font-size:small">Muhammad,</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default" style="font-size:small"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default" style="font-size:small">A long email follows. Please read carefully, visit the links I've provided, and look at the two scripts I've provided.</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default" style="font-size:small"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default" style="font-size:small">As I said in a previous email, you have curvilinear data, which means your data is represented by two-dimensional latitude / longitude arrays. You cannot use coordinate arrays with curvilinear data, as you
are trying to do with this code:</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default">
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="monospace, monospace"> lat1d = fspan(minlat,maxlat,nlat)</font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="monospace, monospace"> lon1d = fspan(minlon,maxlon,nlon)</font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="monospace, monospace"> lat1d@units = "degrees_north"</font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="monospace, monospace"> lon1d@units = "degrees_east"</font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="monospace, monospace"> tc2a = wrf_user_getvar(a, "T2",0)</font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="monospace, monospace"> tc2a@_FillValue = -9999</font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="monospace, monospace"><br>
</font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="monospace, monospace"> tc2a!0 = "lat"</font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="monospace, monospace"> tc2a!1 = "lon"</font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="monospace, monospace"> tc2a&lat = lat1d</font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="monospace, monospace"> tc2a&lon = lon1d</font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default">When you use coordinate arrays via "&", this tells NCL that you have rectilinear data. This will NOT work for your data. To help understand the difference between curvilinear and rectilinear data, please see our "Plotting data on
a map" examples page:</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><a href="http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/plot_data_on_map.shtml</a><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default">In particular, look at these two images, where the actual lat/lon grid is drawn with lines:</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><a href="http://www.ncl.ucar.edu/Applications/Images/dataonmap_grid_1_lg.png" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/Images/dataonmap_grid_1<wbr>_lg.png</a><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><a href="http://www.ncl.ucar.edu/Applications/Images/dataonmap_grid_3_lg.png" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/Images/dataonmap_grid_3<wbr>_lg.png</a><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default">The dataonmap_grid1.ncl script shows how to plot rectilinear data, and the dataonma_grid_3.ncl is plotting curvilinear data.</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default">You said that the code I sent you a couple of days ago was working, so I'm not sure why you went back to trying to use coordinate arrays.</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default">Here's the correct way, which is just copied-and-pasted from the email I sent you before.</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-family:monospace,monospace;font-size:12.8px"> nt = 0</span><span class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail-m_-5317956723310135004m_8949088970929600368gmail-m_1005084403795383051gmail-im" style="font-family:monospace,monospace;font-size:12.8px"><br>
tc2a
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default" style="font-size:small;display:inline"> </div>
= wrf_user_getvar(a, "T2",
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default" style="font-size:small;display:inline"> </div>
</span><span style="font-family:monospace,monospace;font-size:12.8px">nt)</span><br style="font-family:monospace,monospace;font-size:12.8px">
<span style="font-family:monospace,monospace;font-size:12.8px"> </span><span style="font-family:monospace,monospace;font-size:12.8px">tc2a</span><span style="font-family:monospace,monospace;font-size:12.8px">@lat2d = wrf_user_getvar(a, "lat", nt) ; This
is necessary for shapefile masking, but do not</span><br style="font-family:monospace,monospace;font-size:12.8px">
<span style="font-family:monospace,monospace;font-size:12.8px"> </span><span style="font-family:monospace,monospace;font-size:12.8px">tc2a</span><span style="font-family:monospace,monospace;font-size:12.8px">@lon2d = wrf_user_getvar(a,</span>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default" style="font-family:monospace,monospace;display:inline">
</div>
<span style="font-family:monospace,monospace;font-size:12.8px">"lon",</span>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default" style="font-family:monospace,monospace;display:inline">
</div>
<span style="font-family:monospace,monospace;font-size:12.8px">nt) ; write these two attributes to a new NetCDF file!</span><br style="font-family:monospace,monospace;font-size:12.8px">
<span style="font-family:monospace,monospace;font-size:12.8px"> </span><span style="font-family:monospace,monospace;font-size:12.8px">tc2a</span><span style="font-family:monospace,monospace;font-size:12.8px">@_FillValue = -9999</span><br style="font-family:monospace,monospace;font-size:12.8px">
<br style="font-family:monospace,monospace;font-size:12.8px">
<span style="font-family:monospace,monospace;font-size:12.8px"> opt = True</span><br style="font-family:monospace,monospace;font-size:12.8px">
<span style="font-family:monospace,monospace;font-size:12.8px"> opt@debug = True</span><br style="font-family:monospace,monospace;font-size:12.8px">
<span style="font-family:monospace,monospace;font-size:12.8px"> </span><span style="font-family:monospace,monospace;font-size:12.8px">tc2a</span><span style="font-family:monospace,monospace;font-size:12.8px">_mask = shapefile_mask_data(</span><span style="font-family:monospace,monospace;font-size:12.8px">tc2a</span><span style="font-family:monospace,monospace;font-size:12.8px">,"</span><span style="font-family:monospace,monospace;font-size:12.8px">Shap<wbr>efile/malay.shp",opt)</span></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><br>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="arial, helvetica, sans-serif">If you are wanting to apply the same mask to all other variables on the file, then what you can do is have shapefile_mask_data return a mask array, which is an array with 0s and 1s, where
1s represent data that falls inside the area, and 0s represent data that falls outside the area. You can then use this mask array to mask all other variables that are defined on the same lat/lon grid. </font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><font face="arial, helvetica, sans-serif"><br>
</font></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Please see the attached wrf_gsn_5.ncl script, which I adapted from the one on the web. It takes a shapefile that has the Mississippi River Basin outline, and
uses this to mask WRF data that covers the east part of the United States. The WRF data doesn't cover the full area of the Mississippi River Basin, but I wanted to use this example because I can provide you with the data files so you can try it yourself.
</font></span></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">The wrf_gsn_5.ncl script writes the mask array to a NetCDF file, and then the wrf_mask.ncl script shows how you can read this mask array back in and apply
it to other variables on the WRF file. This is MUCH faster than calling shapefile_mask_data every single time. In this case, shapefile_mask_data takes over a minute to create the mask array. Once you have this array, masking data takes a fraction of a second.</font></span></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Try running wrf_gsn_5.ncl first, which will create several plots (to an X11 window). It will also write the mask array to "<a href="http://wrf_mask.nc" target="_blank">wrf_mask.nc</a>".
This script will take over a minute to run.</font></span></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Then, run wrf_mask.ncl, which masks the same variables, but this time it uses the mask array read off
<a href="http://wrf_mask.nc" target="_blank">wrf_mask.nc</a> to mask the data. This script takes a few seconds to run. It will produce a single PNG image, which I've attached.</font></span></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">I've attached the four mrb.xxx files which are the files that represent the shapefile.</font></span></div>
<br>
To get the WRF output fie, which is larger:<br>
<br>
<font face="monospace, monospace">wget <a href="ftp://ftp.cgd.ucar.edu//incoming/wrfout_d01_2005-12-14_13:00:00" target="_blank">
ftp://ftp.cgd.ucar.edu//incomi<wbr>ng/wrfout_d01_2005-12-14_13:00<wbr>:00</a><br>
</font><br>
or:<br>
<br>
<font face="monospace, monospace">ftp <a href="http://ftp.cgd.ucar.edu" target="_blank">ftp.cgd.ucar.edu</a><br>
[login as anonymous]<br>
cd incoming<br>
get wrfout_d01_2005-12-14_13:00:0<wbr>0<br>
quit</font>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">--Mary</font></span></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_default"><br>
</div>
</div>
</div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_extra"><br>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_quote">On Thu, Nov 9, 2017 at 6:39 AM, Muhammad Omer Mughal <span dir="ltr">
<<a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu<wbr>.au</a>></span> wrote:<br>
<blockquote class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi Marry<br>
<br>
Thank you again for the reply. I found the problem after I used CDO the time dimension stripped out from the data. In order to correct this problem I use the following<br>
<span>lat=a->XLAT<br>
lon=a->XLONG<br>
minlat=min(lat)<br>
maxlat=max(lat)<br>
minlon=min(lon)<br>
maxlon=max(lon)<br>
<br>
nlat=129<br>
nlon=210<br>
<br>
lat1d = fspan(minlat,maxlat,nlat)<br>
lon1d = fspan(minlon,maxlon,nlon)<br>
</span><span> lat1d@units = "degrees_north"<br>
lon1d@units = "degrees_east"<br>
</span> tc2a = wrf_user_getvar(a, "T2",0)<br>
tc2a@_FillValue = -9999<br>
<br>
tc2a!0 = "lat"<br>
tc2a!1 = "lon"<br>
tc2a&lat = lat1d<br>
tc2a&lon = lon1d<br>
tc2a_mask = shapefile_mask_data(tc2a,"/dat<wbr>a/muhdomer/NSCC/scratch/Shapef<wbr>iles/SGP_adm0.shp",opt)<br>
<br>
Is there a way to get all variables masked using a shapefile_mask_data command ?<br>
<span><br>
<br>
<br>
<br>
Muhammad Omer Mughal<br>
MSc BSc Mechanical Engineering<br>
PhD Research Scholar<br>
Remote Sensing and Satellite Research Group<br>
Department of Imaging and Applied Physics<br>
Curtin University<br>
<br>
Curtin University<br>
Tel | <a href="tel:%2B61%208%209266%207962" value="+61892667962" target="_blank">+61 8 9266 7962</a><br>
Fax | <a href="tel:%2B61%208%209266%202377" value="+61892662377" target="_blank">+61 8 9266 2377</a><br>
Mobile | 0470 237 525<br>
<br>
</span>Email | <a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu.<wbr>au</a><mailto:<a href="mailto:m.lynch@curtin.edu.au" target="_blank">m.lynch@curtin.edu.a<wbr>u</a>><br>
Web | <a href="http://curtin.edu.au" rel="noreferrer" target="_blank">http://curtin.edu.au</a><<a href="http://curtin.edu.au/" rel="noreferrer" target="_blank">http://cu<wbr>rtin.edu.au/</a>><br>
<span><br>
Curtin University is a trademark of Curtin University of Technology.<br>
CRICOS Provider Code 00301J (WA), 02637B (NSW)<br>
<br>
<br>
______________________________<wbr>__<br>
From: Mary Haley <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>><br>
</span>Sent: Thursday, 9 November 2017 12:30:26 AM<br>
<span>To: Muhammad Omer Mughal<br>
Cc: <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
Subject: Re: [ncl-talk] Masking<br>
<br>
Muhammad,<br>
<br>
</span>
<div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_h5">Something is not right with data2.<br>
<br>
In order to correctly mask curvilinear data, your lat/lon arrays must be the same size as your data. If you look at the output from data2:<br>
<br>
Variable: data2<br>
Type: float<br>
Total Size: 108360 bytes<br>
27090 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [y | 129] x [x | 210]<br>
Coordinates:<br>
Number Of Attributes: 9<br>
lon2d : <ARRAY of 210 elements><br>
lat2d : <ARRAY of 210 elements><br>
stagger :<br>
description : TEMP at 2 M<br>
<br>
The data2 variable is 129 x 210, but the lat2d and lon2d are each 1D arrays of length 210. lat2d and lon2d should be 2D arrays that are the same size as data2.<br>
<br>
However, and this is important, attaching lat2d and lon2d attributes to the data variable is an NCL specific thing for plotting, regridding, and masking, and should NOT be used when writing new data to a file. This is needlessly expensive, because you likely
already have the lat, lon arrays written as separate variables on the file.<br>
<br>
You can look at your original WRF output file to see how curvilinear data is generally represented on a NetCDF file. Here's an example:<br>
<br>
float T2 ( Time, south_north, west_east )<br>
FieldType : 104<br>
MemoryOrder : XY<br>
description : TEMP at 2 M<br>
units : K<br>
stagger :<br>
coordinates : XLONG XLAT XTIME<br>
<br>
Note the "coordinates" attribute attached T2. This is what tells you that the lat/lon arrays associated with T2 are called "XLONG" and "XLAT" on the file, which is what I used earlier to get the lat/lon for masking.<br>
<br>
The data2 variable longer has this coordinates attribute, so either NCO didn't do something correctly, or this variable was modified in some way.<br>
<br>
Please double-check that you are using NCO correctly, and don't write those lat2d / lon2d attributes. Also make sure that the coordinates attribute is included, and that you have the correct XLAT and XLONG variables written to the file. Once you do this,
you can then mask your new data in the exact same way that you did for the original T2 variable.<br>
<br>
--Mary<br>
<br>
<br>
<br>
<br>
<br>
</div>
</div>
<div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_h5">On Wed, Nov 8, 2017 at 12:35 AM, Muhammad Omer Mughal <<a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu<wbr>.au</a><mailto:<a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.<wbr>curtin.edu.au</a>>>
wrote:<br>
Hi Mary<br>
<br>
Thank you for the reply. The adjustment works perfectly to mask the data. I have another question related to this. When I use the wrfoutput file and use the commands lat2d I get this output<br>
<br>
Variable: data3<br>
Type: float<br>
Total Size: 108360 bytes<br>
27090 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [south_north | 129] x [west_east | 210]<br>
Coordinates:<br>
Number Of Attributes: 8<br>
lon2d : <ARRAY of 27090 elements><br>
lat2d : <ARRAY of 27090 elements><br>
coordinates : XLONG XLAT XTIME<br>
stagger :<br>
units : K<br>
description : TEMP at 2 M<br>
MemoryOrder : XY<br>
FieldType : 104<br>
<br>
<br>
When I use this to a sliced file from nco which has changed the attributes of the file I get the following output.<br>
<br>
Variable: data2<br>
Type: float<br>
Total Size: 108360 bytes<br>
27090 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [y | 129] x [x | 210]<br>
Coordinates:<br>
Number Of Attributes: 9<br>
lon2d : <ARRAY of 210 elements><br>
lat2d : <ARRAY of 210 elements><br>
stagger :<br>
description : TEMP at 2 M<br>
MemoryOrder : XY<br>
FieldType : 104<br>
coordinates : XLONG XLAT<br>
units : K<br>
time : 40320<br>
<br>
Also when I use the sliced file to mask the data I get the error<br>
(0) shapefile_mask_data:Error: not a valid rectilinear,curvilinear, or unstructured grid.<br>
<br>
I will appreciate your help<br>
Muhammad Omer Mughal<br>
MSc BSc Mechanical Engineering<br>
PhD Research Scholar<br>
Remote Sensing and Satellite Research Group<br>
Department of Imaging and Applied Physics<br>
Curtin University<br>
<br>
Curtin University<br>
Tel | <a href="tel:+61%208%209266%207962" value="+61892667962" target="_blank">+61 8 9266 7962</a><br>
Fax | <a href="tel:+61%208%209266%202377" value="+61892662377" target="_blank">+61 8 9266 2377</a><br>
Mobile | 0470 237 525<br>
<br>
</div>
</div>
Email | <a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu.<wbr>au</a><mailto:<a href="mailto:m.lynch@curtin.edu.au" target="_blank">m.lynch@curtin.edu.a<wbr>u</a>><br>
Web | <a href="http://curtin.edu.au" rel="noreferrer" target="_blank">http://curtin.edu.au</a><<a href="http://curtin.edu.au/" rel="noreferrer" target="_blank">http://cu<wbr>rtin.edu.au/</a>><br>
<span><br>
Curtin University is a trademark of Curtin University of Technology.<br>
CRICOS Provider Code 00301J (WA), 02637B (NSW)<br>
<br>
<br>
______________________________<wbr>__<br>
</span>From: Mary Haley <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a><mailto:<a href="mailto:haley@ucar.edu" target="_blank">haley@u<wbr>car.edu</a>>><br>
<span>Sent: Wednesday, 8 November 2017 12:42:12 AM<br>
To: Muhammad Omer Mughal<br>
</span>Cc: <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><mailto:<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-t<wbr>alk@ucar.edu</a>><br>
<span>Subject: Re: [ncl-talk] Masking<br>
<br>
Muhammad,<br>
<br>
It looks like you are trying to use a rectilinear lat/lon grid for masking rather than the original lat/lon data associated with your "T2" variable.<br>
<br>
If your file is indeed a WRF output file, then you should use the XLAT/XLONG variables on the file, rather than trying to create your own lat/lon arrays.<br>
<br>
Your code would look something like this:<br>
<br>
nt = 0<br>
data<br>
<br>
= wrf_user_getvar(a, "T2",<br>
<br>
nt)<br>
data@lat2d = wrf_user_getvar(a, "lat", nt)<br>
data@lon2d = wrf_user_getvar(a,<br>
<br>
"lon",<br>
<br>
nt)<br>
data@_FillValue = -9999<br>
<br>
opt = True<br>
opt@debug = True<br>
data_mask = shapefile_mask_data(data,"Shap<wbr>efile/malay.shp",opt)<br>
<br>
<br>
For an example that masks a WRF output file, see example shapefile_14_mask.ncl<br>
<br>
at:<br>
<br>
<a href="http://www.ncl.ucar.edu/Applications/shapefiles.shtml#ex14" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/shapefiles.shtml#ex14</a><br>
<br>
Note that this example is specifying "Ohio" as the specific area in the shapefile to mask against, but if you simply want to use the whole shapefile, then you do not need to set "shape_var" or "shape_names" as this script is doing.<br>
<br>
--Mary<br>
<br>
</span>
<div>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_h5">On Tue, Nov 7, 2017 at 6:48 AM, Muhammad Omer Mughal <<a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu<wbr>.au</a><mailto:<a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.<wbr>curtin.edu.au</a>>>
wrote:<br>
Hi<br>
I am using a WRF output file and I did the following changes "ONLY" to the code[ <a href="https://www.ncl.ucar.edu/Applications/Scripts/mask_9.ncl" rel="noreferrer" target="_blank">
https://www.ncl.ucar.edu/Appli<wbr>cations/Scripts/mask_9.ncl</a>] . I want to mask the temperature in Malaysia using the shape file malay.shp. Can you kindly tell me what else do I need to change as currently I am not able to see the data masked within
Malaysia. I will be grateful for your help<br>
<br>
load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/wrf/WRFUserARW.ncl"<br>
<br>
begin<br>
MASK_INSIDE = True<br>
<br>
a = addfile("./UTC_0.nc","r")<br>
lat=a->XLAT<br>
lon=a->XLONG<br>
<br>
minlat=min(lat)<br>
maxlat=max(lat)<br>
minlon=min(lon)<br>
maxlon=max(lon)<br>
<br>
nlat=129<br>
nlon=210<br>
<br>
lat1d = fspan(minlat,maxlat,nlat)<br>
lon1d = fspan(minlon,maxlon,nlon)<br>
<br>
data = wrf_user_getvar(a, "T2", 0)<br>
data@_FillValue = -9999<br>
<br>
<br>
<br>
lat1d = fspan(minlat,maxlat,nlat)<br>
lon1d = fspan(minlon,maxlon,nlon)<br>
lat1d@units = "degrees_north"<br>
lon1d@units = "degrees_east"<br>
<br>
;---Attach lat/lon coordinate array information.<br>
data!0 = "lat"<br>
data!1 = "lon"<br>
data&lat = lat1d<br>
data&lon = lon1d<br>
<br>
<br>
<br>
f = addfile("Shapefile/malay.shp", "r")<br>
mrb_lon = f->x<br>
mrb_lat = f->y<br>
nmrb = dimsizes(mrb_lon)<br>
<br>
min_mrb_lat = min(mrb_lat)<br>
max_mrb_lat = max(mrb_lat)<br>
min_mrb_lon = min(mrb_lon)<br>
max_mrb_lon = max(mrb_lon)<br>
<br>
<br>
</div>
</div>
<a href="http://www.ncl.ucar.edu" rel="noreferrer" target="_blank">www.ncl.ucar.edu</a><<a href="https://www.ncl.ucar.edu/Applications/Scripts/mask_9.ncl" rel="noreferrer" target="_blank">https://www.n<wbr>cl.ucar.edu/Applications/Scrip<wbr>ts/mask_9.ncl</a>><br>
<a href="http://www.ncl.ucar.edu" rel="noreferrer" target="_blank">www.ncl.ucar.edu</a><<a href="http://www.ncl.ucar.edu" rel="noreferrer" target="_blank">http://www.nc<wbr>l.ucar.edu</a>><br>
<span>;***** ; mask_9.ncl ; ; Concepts illustrated: ; - Drawing the Mississippi River Basin using data from a shapefile ; - Masking a data array based on a geographical ...<br>
<br>
<br>
<br>
</span><a href="http://www.ncl.ucar.edu" rel="noreferrer" target="_blank">www.ncl.ucar.edu</a><<a href="https://www.ncl.ucar.edu/Applications/Scripts/mask_9.ncl" rel="noreferrer" target="_blank">https://www.n<wbr>cl.ucar.edu/Applications/Scrip<wbr>ts/mask_9.ncl</a>><br>
<a href="http://www.ncl.ucar.edu" rel="noreferrer" target="_blank">www.ncl.ucar.edu</a><<a href="http://www.ncl.ucar.edu" rel="noreferrer" target="_blank">http://www.nc<wbr>l.ucar.edu</a>><br>
<span>;***** ; mask_9.ncl ; ; Concepts illustrated: ; - Drawing the Mississippi River Basin using data from a shapefile ; - Masking a data array based on a geographical ...<br>
<br>
<br>
<br>
<br>
Muhammad Omer Mughal<br>
MSc BSc Mechanical Engineering<br>
PhD Research Scholar<br>
Remote Sensing and Satellite Research Group<br>
Department of Imaging and Applied Physics<br>
Curtin University<br>
<br>
Curtin University<br>
Tel | <a href="tel:%2B61%208%209266%207962" value="+61892667962" target="_blank">+61 8 9266 7962</a><br>
Fax | <a href="tel:%2B61%208%209266%202377" value="+61892662377" target="_blank">+61 8 9266 2377</a><br>
Mobile | 0470 237 525<br>
<br>
</span>Email | <a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu.<wbr>au</a><mailto:<a href="mailto:m.lynch@curtin.edu.au" target="_blank">m.lynch@curtin.edu.a<wbr>u</a>><br>
Web | <a href="http://curtin.edu.au" rel="noreferrer" target="_blank">http://curtin.edu.au</a><<a href="http://curtin.edu.au/" rel="noreferrer" target="_blank">http://cu<wbr>rtin.edu.au/</a>><br>
<span><br>
Curtin University is a trademark of Curtin University of Technology.<br>
CRICOS Provider Code 00301J (WA), 02637B (NSW)<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
</span><a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><mailto:<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-t<wbr>alk@ucar.edu</a>><br>
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_HOEnZb">
<div class="gmail-m_-2487880908988443009gmail-m_-8705046733339841361gmail-m_-1608048126952235171x_h5">List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br>
<br>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div></div></div>
</blockquote></div><br></div></div>