<div dir="ltr"><div><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/bin_sum.shtml"><b>bin_sum</b></a> returns the 'sums'. I am pretty sure it does what you want.</div><div>===</div><div>There is no need to average. What I sent was just extracted from the exaample provided by the bin_sum documentation.</div><div><br></div><div>==</div><div><br></div><div>We can small the smoke. At times we can can have ashes from the fires falling.</div><div><br></div><div>Stay Healthy<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 19, 2020 at 3:56 PM Paimazumder, Debasish <<a href="mailto:Debasish.Paimazumder@aig.com">Debasish.Paimazumder@aig.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_877697973867310141WordSection1">
<p class="MsoNormal">Hi Dennis,<u></u><u></u></p>
<p class="MsoNormal">Thanks for your response. Nice to hear from you and hope you are doing well and safe from recent wildfire in north boulder.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m not sure that I understand the bin_sum function specially the second part (‘user must perform averaging’).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">For my case, dlon, dlat and d are from csv file and lat/lon from netcdf file. See blow their dimension. I would like create new variable at lat/lon grid by summing all d based on number of dlon, dlat within each of lat/lon grid.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">For example – if we have 50 dlat/dlon in one latXlon grid, then new variable in lat/lon grid = sum of d from all 50 dlat/dlon.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">With regards<u></u><u></u></p>
<p class="MsoNormal">-Dave<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Variable: dlat<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Type: float<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Total Size: 1392092 bytes<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> 348023 values<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Number of Dimensions: 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Dimensions and sizes: [348023]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Coordinates:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Number Of Attributes: 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> _FillValue : 9.96921e+36<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Variable: dlon<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Type: float<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Total Size: 1392092 bytes<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> 348023 values<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Number of Dimensions: 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Dimensions and sizes: [348023]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Coordinates:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Number Of Attributes: 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> _FillValue : 9.96921e+36<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Variable: d<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Type: float<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Total Size: 1392092 bytes<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> 348023 values<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Number of Dimensions: 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Dimensions and sizes: [348023]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Coordinates:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Number Of Attributes: 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> _FillValue : 9.96921e+36<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b>Output grid –<u></u><u></u></b></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Variable: lat<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Type: float<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Total Size: 744 bytes<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> 186 values<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Number of Dimensions: 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Dimensions and sizes: [lat | 186]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Coordinates:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> lat: [-46.375..-0.125]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Number Of Attributes: 4<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> units : degree_north<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> standard_name : latitude<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> long_name : latitude<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> bounds : lat_bnds<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Variable: lon<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Type: float<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Total Size: 964 bytes<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> 241 values<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Number of Dimensions: 1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Dimensions and sizes: [lon | 241]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Coordinates:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> lon: [100.125..160.125]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)">Number Of Attributes: 4<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> units : degree_east<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> standard_name : longitude<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> long_name : longitude<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(32,56,100)"> bounds : lon_bnds<u></u><u></u></span></p>
<p class="MsoNormal"><b>From:</b> Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> <br>
<b>Sent:</b> Sunday, October 18, 2020 2:25 PM<br>
<b>To:</b> Paimazumder, Debasish <<a href="mailto:Debasish.Paimazumder@aig.com" target="_blank">Debasish.Paimazumder@aig.com</a>><br>
<b>Cc:</b> Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>>; ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br>
<b>Subject:</b> [EXTERNAL] Re: [ncl-talk] accumulate data on grid<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:12pt"><b><span style="color:gray">This message is from an external sender; be cautious with links and attachments.</span></b><u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">Maybe the <b>"bin" <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ncl.ucar.edu_Applications_binning.shtml&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=6F7M48QNHan0cjDH_KWLNBKvEM8Z4MLy0AVrfi5jQo8&s=esBoEZ_hYSHMOH9ETaF6M17fqzbclWD-fQGCOTkzhL0&e=" target="_blank">
examples</a> /</b> <b>functions</b>: <b><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ncl.ucar.edu_Document_Functions_Built-2Din_bin-5Fsum.shtml&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=6F7M48QNHan0cjDH_KWLNBKvEM8Z4MLy0AVrfi5jQo8&s=xnFvaC2e9cElHG3_pafK084oquAu_2dJsejynvv5C-k&e=" target="_blank">
bin_sum</a></b> ,<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ncl.ucar.edu_Document_Functions_Built-2Din_bin-5Favg.shtml&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=6F7M48QNHan0cjDH_KWLNBKvEM8Z4MLy0AVrfi5jQo8&s=9NeB2QchXaY0pnTSSuyn5Qmj-7oUsC6EfwD4EXGQNYA&e=" target="_blank"><b>
bin_avg</b></a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Assuming the data are randomly located: d(npts), dlat(npts), dlon(npts)
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><b>**AND**</b> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">the target grid is <b>RECTILINEAR</b> with grid locations/sizes: glon[mlon], glat[nlat]<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<pre> gbin = <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ncl.ucar.edu_Document_Functions_Built-2Din_new.shtml&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=6F7M48QNHan0cjDH_KWLNBKvEM8Z4MLy0AVrfi5jQo8&s=R3wqMSXgnUywYdf9AP9u9NrETGphvJvVf7GItjprpxI&e=" target="_blank"><strong><span style="font-family:"Courier New"">new</span></strong></a> ( (/nlat,mlon/), float ) <u></u><u></u></pre>
<pre> gknt = <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ncl.ucar.edu_Document_Functions_Built-2Din_new.shtml&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=6F7M48QNHan0cjDH_KWLNBKvEM8Z4MLy0AVrfi5jQo8&s=R3wqMSXgnUywYdf9AP9u9NrETGphvJvVf7GItjprpxI&e=" target="_blank"><strong><span style="font-family:"Courier New"">new</span></strong></a> ( (/nlat,mlon/), integer) <u></u><u></u></pre>
<pre><u></u> <u></u></pre>
<pre> gbin = 0.0 ; initialization<u></u><u></u></pre>
<pre> gknt = 0 <u></u><u></u></pre>
</div>
<div>
<pre> <strong><span style="font-family:"Courier New"">bin_sum</span></strong>(gbin,gknt,glon,glat,dlon,dlat,d)<br><br>;*****************************************************************<u></u><u></u></pre>
<pre>; User must perform averaging<u></u><u></u></pre>
<pre>;*****************************************************************<u></u><u></u></pre>
<pre> ; avoid division by 0<u></u><u></u></pre>
<pre> gknt = <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ncl.ucar.edu_Document_Functions_Built-2Din_where.shtml&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=6F7M48QNHan0cjDH_KWLNBKvEM8Z4MLy0AVrfi5jQo8&s=4SbR5DjHbZc8obQVy_1-w-LH_brR9Bnv0Ixv8K46mA0&e=" target="_blank"><strong><span style="font-family:"Courier New"">where</span></strong></a>(gknt.eq.0 , gknt@_FillValue, gknt)<u></u><u></u></pre>
<pre><u></u> <u></u></pre>
<pre> gbin = gbin/gknt<u></u><u></u></pre>
<pre> <u></u><u></u></pre>
<pre> gbin!0 = "lat"<u></u><u></u></pre>
<pre> gbin!1 = "lon"<u></u><u></u></pre>
<pre> gbin&lat = glat<u></u><u></u></pre>
<pre> gbin&lon = lon<u></u><u></u></pre>
<pre><u></u> <u></u></pre>
<pre> <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ncl.ucar.edu_Document_Functions_Contributed_copy-5FVarCoords.shtml&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=6F7M48QNHan0cjDH_KWLNBKvEM8Z4MLy0AVrfi5jQo8&s=H8H1S0QA3naQXQKhJSuJAT2QNQyKzwCTxbukEdlFtI8&e=" target="_blank"><strong><span style="font-family:"Courier New"">copy_VarCoords</span></strong></a>(gbin, gknt) ; copy coords<u></u><u></u></pre>
<pre><u></u> <u></u></pre>
<pre> if (<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ncl.ucar.edu_Document_Functions_Built-2Din_isfilevaratt.shtml&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=6F7M48QNHan0cjDH_KWLNBKvEM8Z4MLy0AVrfi5jQo8&s=pbnNxst9G_K0_R0bUV0jHQfBbWTAjBmkwShzIGuJjwE&e=" target="_blank"><strong><span style="font-family:"Courier New"">isfilevaratt</span></strong></a>(f, vNam, "long_name")) then<u></u><u></u></pre>
<pre> gbin@long_name = "BINNED: "+vNam<u></u><u></u></pre>
<pre> gknt@long_name = "BINNED COUNT: "+vNam<u></u><u></u></pre>
<pre> end if<u></u><u></u></pre>
<pre><u></u> <u></u></pre>
<pre> if (<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ncl.ucar.edu_Document_Functions_Built-2Din_isfilevaratt.shtml&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=6F7M48QNHan0cjDH_KWLNBKvEM8Z4MLy0AVrfi5jQo8&s=pbnNxst9G_K0_R0bUV0jHQfBbWTAjBmkwShzIGuJjwE&e=" target="_blank"><strong><span style="font-family:"Courier New"">isfilevaratt</span></strong></a>(f, vNam, "units")) then<u></u><u></u></pre>
<pre> gbin@units = f->$vNam$@units<u></u><u></u></pre>
<pre> end if<u></u><u></u></pre>
<pre style="margin-bottom:12pt"><u></u> <u></u></pre>
<pre> printVarSummary(gbin)<br> printMinMax(gbin,1)<br> print("=========")<br> print("=========")<br> printVarSummary(gknt) <br> printMinMax(gbin,1)<br><br>====<u></u><u></u></pre>
<pre>Note: If the target grid is <b>CURVILINEAR</b>: [ glat(nlat,mlon), glon(nlat,mlon], there is no NCL function to accomplish the task.<u></u><u></u></pre>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Sun, Oct 18, 2020 at 11:32 AM Paimazumder, Debasish via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal">Dave- <span style="color:black">getind_latlon2d needs two-dimensional lat/lon while my output grid 1-d lat/lon. </span>
<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:12pt"><span style="color:black">Interpolation from location to 1-d grid could be an option but we won’t get the accumulation (sum) at the output grid.</span><u></u><u></u></p>
<div>
<p class="MsoNormal">Best regards, <u></u><u></u></p>
<div>
<p class="MsoNormal">Dave<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><br>
<br>
<u></u><u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<p class="MsoNormal" style="margin-bottom:12pt">On Oct 18, 2020, at 12:54 PM, Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>> wrote:<u></u><u></u></p>
</blockquote>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:12pt"><b><span style="color:gray">This message is from an external sender; be cautious with links and attachments.</span></b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Right, that can be done. Or, you can interpolate the data from the fine to coarse grid.
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I am not sure if the latter will conserve the averages like doing the averaging in a loop.<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Sun, Oct 18, 2020 at 6:58 PM Dave Allured - NOAA Affiliate via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal">Use the function <b>getind_latlon2d</b> to get the (i,j) grid point indices for the point data coordinates. Then do a single loop over the point data to accumulate sums and counts on the output grid.
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Sun, Oct 18, 2020 at 9:09 AM Paimazumder, Debasish via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal">Hi Barry, <u></u><u></u></p>
<div>
<p class="MsoNormal">Thanks for your response. Actually I don’t have time dimension. I have location level data (at high resolution).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">For example, x(m) with lat(m) and lon (m) where m = 300k location <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">My output grid is 32x32 km and I would like to do following <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">1. Estimate the number of locations are in each 32x32 km grid<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">2. Accumulate (sum) the x at each output grid.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12pt">For example- if I have 100 locations at one of the 32x32km grid, I will sum all x from 100 locations and assign the sum to the output grid.<u></u><u></u></p>
<div>
<p class="MsoNormal">Best regards, <u></u><u></u></p>
<div>
<p class="MsoNormal">Dave<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><br>
<br>
<u></u><u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<p class="MsoNormal">On Oct 18, 2020, at 3:50 AM, Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>> wrote:<u></u><u></u></p>
</blockquote>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<div>
<p class="MsoNormal">Hi: <u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If you have two grids of the same dimensions, but different times, you can simply add them together.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If you have grids of a different size, you can interpolate the data to this grid, one grid at a time.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">See for example:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ncl.ucar.edu_Applications_regrid.shtml&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=IaFm8AuXStzIPZXMbIRmp6fjt5zy74eAUUQzoQb5pBc&s=tUIMDu-yehcnE2-mHTaX2NhZiAg5eBHJsqf3e1Bmbl8&e=" target="_blank">https://www.ncl.ucar.edu/Applications/regrid.shtml</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">This may also help.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ncl.ucar.edu_Document_Functions_Built-2Din_dim-5Fsum-5Fn.shtml&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=IaFm8AuXStzIPZXMbIRmp6fjt5zy74eAUUQzoQb5pBc&s=4tdKFBxFBOUpMYFj95WyO8MUdUcYRniTWsJIvCCbhAE&e=" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_sum_n.shtml</a><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Sun, Oct 18, 2020 at 7:59 AM Paimazumder, Debasish via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">Hi NCL users<u></u><u></u></p>
<p class="MsoNormal">I have location level data and 2d lat, lon grid and I’m trying to accumulate the data on 2d lat, lon grid.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">For example
<u></u><u></u></p>
<p class="MsoNormal">Input - x (n) with lat(n), lon(n)<u></u><u></u></p>
<p class="MsoNormal">Output grid - lat(i)xlon(j)<u></u><u></u></p>
<p class="MsoNormal">I’m trying to estimate number of location within each grid and accumulate x at each grid.
<u></u><u></u></p>
<p class="MsoNormal">Is there any function in NCL that will solve this problem?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">With regards<u></u><u></u></p>
<p class="MsoNormal">-Debasish
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:12pt;color:rgb(0,176,240)">Debasish PaiMazumder, PhD |</span></b><span style="font-size:12pt;color:rgb(102,102,102)">Tel
<a href="tel:%2B1%20215%20255%206371" target="_blank">+1 215 255 6052</a> | Cell <a href="tel:%2B1%20718%20913%206946" target="_blank">
+1 267 449 5226</a> |</span><u><span style="font-size:12pt;color:blue"><a href="mailto:Debasish.Paimazumder@aig.com" target="_blank">Debasish.Paimazumder@aig.com</a></span></u><u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__mailman.ucar.edu_mailman_listinfo_ncl-2Dtalk&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=MrHhJNEEUYaIu_m4tHYe3BagQB4y_F9zUKivzqyU6Qc&s=OAPVqMfiOsSTA-yHW1I4powc9uQpzwob8irpoxiBBy0&e=" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Barry H. Lynn, Ph.D <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Senior Associate Scientist, Lecturer,<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:rgb(136,136,136)">The Institute of the Earth Science, <br>
The Hebrew University of Jerusalem, <br>
Givat Ram, Jerusalem 91904, Israel </span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span style="color:rgb(136,136,136)">Tel: 972 547 231 170<br>
Fax: (972)-25662581</span><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12pt">C.E.O, Weather It Is, LTD<br>
Weather and Climate Focus<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__weather-2Dit-2Dis.com&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=MrHhJNEEUYaIu_m4tHYe3BagQB4y_F9zUKivzqyU6Qc&s=wTDx59WcqkIpQWlxXtecOdqmP_2sM2GEo2mXT7ZAaPw&e=" target="_blank">http://weather-it-is.com</a><br>
Jerusalem, Israel<br>
Local: 02 930 9525<br>
Cell: 054 7 231 170<br>
Int-IS: x972 2 930 9525<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__mailman.ucar.edu_mailman_listinfo_ncl-2Dtalk&d=DwMFaQ&c=kn4_INW_mBCDHV_xJEVJkg&r=fpudUXThXLQwAKQPDCnmVaSzm2dwE9OxcWi7MuJ0jbo&m=6F7M48QNHan0cjDH_KWLNBKvEM8Z4MLy0AVrfi5jQo8&s=JHsKhKBBboyoxNbA9b8hgUBDyt3F_iBYSmaDbFnDfy0&e=" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</blockquote></div>