<div dir="ltr"><div dir="ltr">Distance:   <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/gc_latlon.shtml"><b>http://www.ncl.ucar.edu/Document/Functions/Built-in/gc_latlon.shtml</b></a><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 13, 2018 at 1:19 AM Kunal Bali <<a href="mailto:kunal.bali9@gmail.com">kunal.bali9@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr" class="m_861851138785188342gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear NCL users,</div><div dir="ltr"><br></div><div dir="ltr">I need to calculate the inverse weighted distance according to the attached figure</div><div dir="ltr"><br></div><div dir="ltr">The formula is </div><div dir="ltr"><b>xAvg = SUM[<font color="#ff0000">X</font>/<font color="#0000ff">w</font>]/SUM[1/<font color="#0000ff">w</font>]</b>.  equation (1)</div><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr">So first I need to calculate the distance from surrounding grid cells to the receptor cell </div><div dir="ltr"><br></div><div dir="ltr">receptor cell coordinates</div><div dir="ltr">  latz = (/23.285/)</div><div dir="ltr">  lonz = (/77.276/)</div></div><div dir="ltr"><br></div><div dir="ltr">I don't know how to calculate this distance from single receptor site to its surroundings grid cells. Surrounding grid cells spread ~500 km. <br></div><div dir="ltr"><div dir="ltr"><br></div></div><div dir="ltr"><br></div><div dir="ltr">I have calculated the <b><font color="#ff0000">X</font></b> here (which is a coefficient of divergence)</div><div dir="ltr"><br></div><div dir="ltr">and the coefficient of divergence is calculated as </div><div dir="ltr"> ;-----calculation of the coefficient of divergence</div><div dir="ltr">   DATA_SINGLE_3D = conform(data_subset, data_single, 0)  </div><div dir="ltr">   x1 = (DATA_SINGLE_3D - data_subset)</div><div dir="ltr">   x2 = (DATA_SINGLE_3D + data_subset)</div><div dir="ltr">   CoD1   = (x1/where(x2.ne.0,x2,x2@_FillValue))^2 </div><div dir="ltr"><br></div><div dir="ltr">   CoD2 = dim_avg_n_Wrap(CoD1, 0)    ; (nlat,mlon)</div><div dir="ltr">   CoD_final = sqrt(CoD2)</div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">So please provide some information on that. I have attached the script here.</div><div dir="ltr"><br></div><div dir="ltr">regards</div><div dir="ltr">---</div><div dir="ltr">Kunal Bali</div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>