<div dir="ltr"><div dir="ltr"><div>Hi Philippe,</div><div>I think, it makes sense to expect two same lat or lon for a circle since at two different longitudes there could be possibility of getting two latitudes and vice versa. To get unique values, you can use the following function:</div><div>For example:</div><div><br></div><div> y:= get_unique_values(y)</div><div><br></div><div><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/get_unique_values.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/get_unique_values.shtml</a></div><div><br></div><div>Cheers,</div><div>Rashed<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 26, 2019 at 2:51 PM Philippe Papin <<a href="mailto:pppapin@gmail.com">pppapin@gmail.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 dir="ltr">Hi All,<div><br></div><div>I've been running into an issue from the combined usage of the "get_isolines" and "area_poly_sphere" functions. First, I'm using get_isolines to isolate a contour that completes loop around some location on the globe. Then I want to find the area within that contour.</div><div><br></div><div>What I've noticed is that occasionally (not always) the get_isolines function will find a contour with multiple identical lat,lon pairs for the given contour. This is problematic for the area_poly_sphere code which requires unique vertex points as far as I can tell.</div><div><br></div><div>Is there anyway to avoid get_isolines from providing identical lat,lon points for a unique contour? If not, is there a function I could use to remove non-unique lat,lon pairs? </div><div><br></div><div>Here is a print out snippet of the relevant get_isolines output of what I'm trying to avoid (see index values 212,213). </div><div><br></div><div>





<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Variable: x</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Type: float</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Total Size: 2452 bytes</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-4985925652278827231gmail-Apple-converted-space">            </span>613 values</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 1</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>[points | 613]</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Coordinates:<span class="gmail-m_-4985925652278827231gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Number Of Attributes: 5</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-4985925652278827231gmail-Apple-converted-space">  </span>n_points :<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>( 4, 613, 29, 7, 21, 41, 38, 45, 29 )</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-4985925652278827231gmail-Apple-converted-space">  </span>start_point :<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>( 0, 4, 617, 646, 653, 674, 715, 753, 798 )</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-4985925652278827231gmail-Apple-converted-space">  </span>segment_count :<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>9</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-4985925652278827231gmail-Apple-converted-space">  </span>level :<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span> 2</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-4985925652278827231gmail-Apple-converted-space">  </span>_FillValue :<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>9.96921e+36</span></p><p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p></div><div>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">(211)<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>17.06323</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">(212)<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>16</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">(213)<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>16</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">(214)<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>14.94309</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">(215)<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>13.88631</span></p></div><div><br></div><div>





<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Variable: y</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Type: float</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Total Size: 2452 bytes</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-4985925652278827231gmail-Apple-converted-space">            </span>613 values</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 1</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>[points | 613]</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Coordinates:<span class="gmail-m_-4985925652278827231gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">Number Of Attributes: 5</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-4985925652278827231gmail-Apple-converted-space">  </span>n_points :<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>( 4, 613, 29, 7, 21, 41, 38, 45, 29 )</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-4985925652278827231gmail-Apple-converted-space">  </span>start_point :<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>( 0, 4, 617, 646, 653, 674, 715, 753, 798 )</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-4985925652278827231gmail-Apple-converted-space">  </span>segment_count :<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>9</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-4985925652278827231gmail-Apple-converted-space">  </span>level :<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span> 2</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-m_-4985925652278827231gmail-Apple-converted-space">  </span>_FillValue :<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>9.96921e+36</span></p><p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p></div><div>





<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">(211)<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>69.65783</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">(212)<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>69.83716</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">(213)<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>69.83716</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">(214)<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>70.0269</span></p>
<p class="gmail-m_-4985925652278827231gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Andale Mono";color:rgb(47,255,18);background-color:rgba(0,0,0,0.9)"><span class="gmail-m_-4985925652278827231gmail-s1" style="font-variant-ligatures:no-common-ligatures">(215)<span class="gmail-m_-4985925652278827231gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>70.21735</span></p></div><div><br clear="all"><div>It seems like the code is outputting an unnecessary extra lat,lon pair at 69.83716 N, 16E. Why does this happen, and how can I avoid this for accurate spherical area calculations?</div><div><br></div><div>Thanks,</div><div>Philippe</div>-- <br><div dir="ltr" class="gmail-m_-4985925652278827231gmail_signature"><div dir="ltr"><div><div><br></div><div><div style="font-size:12.8px">-------------------------------------</div><div style="font-size:12.8px">Philippe P. Papin, Ph.D.<br><div><div style="font-size:13px">NRC Research Associate</div><div style="font-size:13px">Global Modeling Division</div><div style="font-size:13px">Naval Research Laboratory - Monterey, CA </div></div></div><div style="font-size:12.8px"><font face="arial, sans-serif" color="#222222"><a href="http://www.atmos.albany.edu/student/ppapin/" target="_blank">http://www.atmos.albany.edu/student/ppapin/</a></font></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>