<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<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">Hi Ning,</p>
<p style="margin-top:0;margin-bottom:0"> I think as long as you have the missing value defined, you should be able to use "where": <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml" class="OWAAutoLink" id="LPlnk985055" previewremoved="true">https://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml</a></p>
<div><br>
</div>
<div>There are some examples there that seem to do what you want. Basically, something like:</div>
<br>
<p style="margin-top:0;margin-bottom:0">T2 = where(ismissing(T2),T5,T2) ; assuming the arrays are the same size</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p><span style="color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px">Nick Bassill, PhD</span></p>
<p style="color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px">
Modeler & Meteorologist, Center Of Excellence (Prior: NYS Mesonet)</p>
<p style="color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px">
LC SB-28, 1400 Washington Ave.,</p>
<p style="color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px">
SUNY, University at Albany, NY 12222</p>
(518) 442-6375</div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
NYSM Products: <a href="http://operations.nysmesonet.org/~nbassill/" class="OWAAutoLink" id="LPNoLP">http://operations.nysmesonet.org/~nbassill/</a></div>
</div>
</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 face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> ncl-talk <ncl-talk-bounces@ucar.edu> on behalf of ma.n2007 <ma.n2007@aliyun.com><br>
<b>Sent:</b> Wednesday, April 18, 2018 9:45 AM<br>
<b>To:</b> ncl-talk<br>
<b>Subject:</b> [ncl-talk] updated-how to replace missing value</font>
<div> </div>
</div>
<div>
<div><span></span>
<div style="font-size:14.6667px">Hi Sir,</div>
<div style="font-size:14.6667px">Let me show my question in a more clear manner. If I have two data: T2 (time, lat, lon) is 2 m temperature, and T5(time, lat, lon) is 5 m temperature.</div>
<div style="font-size:14.6667px"><br>
</div>
<div style="font-size:14.6667px">T2 is what I want to use, but in some cases T2 has missing values. I want to use T5 data (if this grid is not missing value) to fill T2's missing value. Could you please tell me how can I do? Thanks so much!</div>
<div style="font-size:14.6667px"><br>
</div>
<div style="font-size:14.6667px"><br>
</div>
<div style="font-size:14.6667px">Ning</div>
</div>
<div><br>
</div>
<div><br>
</div>
<hr color="#b5c4df" size="1" align="left" style="width:210px; height:1px; display:none">
<div><span></span></div>
<blockquote style="margin-top:0px; margin-bottom:0px; margin-left:0.5em">
<div> </div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<div style="padding-right:8px; padding-left:8px; font-size:12px; font-family:tahoma; color:#000000; background:#efefef; padding-bottom:8px; padding-top:8px">
<div><b>From:</b> <a href="mailto:ma.n2007@aliyun.com" id="LPlnk479926" previewremoved="true">ma.n2007</a></div>
<div><b>Date:</b> 2018-04-18 21:38</div>
<div><b>To:</b> <a href="mailto:ncl-talk@ucar.edu" id="LPlnk247660" previewremoved="true">ncl-talk</a></div>
<div><b>Subject:</b> [ncl-talk] how to replace missing value</div>
</div>
</div>
<div>
<div class="x_FoxDiv20180418214052347461">
<div><span></span></div>
<blockquote style="margin-top:0px; margin-bottom:0px; margin-left:0.5em">
<div>
<div class="x_FoxDiv20180418213629844843">
<div>Hi Sir,</div>
<div>Imagin that I have two data X and Y, both are with (tim, lat, lon).</div>
<div>If some grids of Y has missing values, while X does not. How can I replace the missing values in Y with the X grid value? This could fill the Y.</div>
<div>Could you please help me? </div>
<div><br>
</div>
<div>Thanks</div>
<div>Ning</div>
<div><br>
</div>
<hr color="#b5c4df" size="1" align="left" style="width:210px; height:1px; display:none">
<div><span></span></div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>