<div dir="ltr">Thank you both for your suggestions. <div><br></div><div>I went with what Alan showed me and it worked like I was hoping. </div><div><br></div><div>Thanks again, </div><div>Jake</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 14, 2017 at 11:58 AM, Alan Brammer <span dir="ltr">&lt;<a href="mailto:abrammer@albany.edu" target="_blank">abrammer@albany.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div>Hi Jake, <div><br></div><div>From that square, which should fully encompass your circle. You could then pass the latitude and longitudes of the grid points to <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/gc_inout.shtml" target="_blank">gc_inout</a> to find which grid points are actually within your circle. <div><br></div><div>e.g.  (not tested, always test and double check)</div><div><font face="Menlo"><br></font></div><div><font face="Andale Mono">;; Make lat and lon a 2d grid </font></div><div><font face="Andale Mono">lat2d = conform( <span style="font-size:11px"> newTRMMyearly,</span></font><span style="font-family:&#39;Andale Mono&#39;;font-size:11px">newTRM<wbr>Myearly&amp;lat,</span><span style="font-size:11px;font-family:&#39;Andale Mono&#39;"> 0)   ; coord names may not be correct </span></div><div><font face="Andale Mono">lon2d = conform( <span style="font-size:11px"> </span><span style="font-size:11px">newTRMMyearly,</span></font><span style="font-family:&#39;Andale Mono&#39;;font-size:11px">newTRM<wbr>Myearly&amp;lon,</span><span style="font-size:11px;font-family:&#39;Andale Mono&#39;"> 1)</span></div><div><span style="font-size:11px"><font face="Andale Mono"><br></font></span></div><div><span style="font-size:11px"><font face="Andale Mono">in_circle = gc_inout( lat2d, lon2d, clat, clon)</font></span></div><div><font face="Andale Mono"><span style="font-size:11px">newTRMMyearly = where( in_circle, </span><span style="font-size:11px">newTRMMyearly, </span><span style="font-size:11px">newT<wbr>RMMyearly@_FillValue) ; mask points out of circle</span></font></div><div><span style="font-size:11px"><font face="Menlo"><br></font></span></div><div><span style="font-size:11px"><font face="Menlo"><br></font></span></div><div>set gsnAddCyclic = False and you should be able to plot the grid on a map. </div><div><br></div><div>Good luck,</div><span class="HOEnZb"><font color="#888888"><div> </div><div><span class="m_-7245083775020704180Apple-tab-span" style="white-space:pre-wrap">        </span>Alan</div><div><font face="Menlo"><span style="font-size:11px"><br></span></font></div></font></span><div><font face="Menlo"><span style="font-size:11px"><br></span></font><div><blockquote type="cite"><div><div class="h5"><div>On Aug 13, 2017, at 2:43 PM, Jake Huff &lt;<a href="mailto:jake.huff@stonybrook.edu" target="_blank">jake.huff@stonybrook.edu</a>&gt; wrote:</div><br class="m_-7245083775020704180Apple-interchange-newline"></div></div><div><div><div class="h5"><div dir="ltr">Hello,<div><br></div><div>I am working on reading in precipitation data that corresponds to a radius of a 500km around a tropical cyclone. I have a variable that contains precipitation over the Eastern US and into the Atlantic Ocean. Below is some of my code. </div><div><br></div><div>;Snippet of code </div><div><br></div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">obtracks = addfile(&quot;<a href="http://allstorms.ibtracs_wmo.v03r05.nc/" target="_blank">Allstorms.ibtracs_<wbr>wmo.v03r05.nc</a>&quot;,&quot;r&quot;) ;Read in IBTrACS</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">lat_wmo = short2flt(obtracks-&gt;lat_wmo) ;(storm,time)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">lon_wmo = short2flt(obtracks-&gt;lon_wmo) ;(storm,time)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br><span style="font-variant-ligatures:no-common-ligatures"></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">; Read in Precipitation Files</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br><span style="font-variant-ligatures:no-common-ligatures"></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">precipfile = addfile(&quot;TRMMdata.nc&quot;,&quot;r&quot;)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">AvgYearlyTRMM = precipfile-&gt;AvgYearlyTRMM   ;(time,lat,lon)</span></div></div><div><br></div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">clat = new(61,float)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">clon = new(61,float)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">radius = 5.0</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">lat_location = lat_wmo(0,0) ; location for 1st TC and time step<br><span style="font-variant-ligatures:no-common-ligatures"></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">lon_location = lon_wmo(0,0) ; location for 1st TC and time step</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">nggcog(lat_location,lon_<wbr>location,radius,clat,clon) ;calculate circle</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">min_lat = min(clat)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">max_lat = max(clat)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">min_lon = min(clon)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">max_lon = max(clon)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br><span style="font-variant-ligatures:no-common-ligatures"></span></div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br class="m_-7245083775020704180webkit-block-placeholder"></p><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">newTRMMyearly = AvgYearlyTRMM(0,{min_lat:max_<wbr>lat},{min_lon:max_lon}) ;reads in square of data</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><span style="font-family:arial,sans-serif;font-size:small">So the above reads in the data correctly but gives me a square of data instead of the circle that I create with the nggcog function above since I&#39;m using the min/max of the circle.</span><br></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><br></div><div style="margin:0px;line-height:normal">I was wanting to know if anyone knows of a way to read in the clat/clon from my AvgYearlyTRMM dataset. I have attempted some indexing of the clat/clon varibles to put the index into AvgYearlyTRMM, but then the lat/lon arrays are no longer monotonic so trying to use gsn_csm_contour_map doesn&#39;t work. <br></div><br><div style="margin:0px;line-height:normal"><br></div><div style="margin:0px;line-height:normal">Thanks for any help.</div><div style="margin:0px;line-height:normal">Jake</div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> </span></p></div></div></div></div>
______________________________<wbr>_________________<span class=""><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" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br></span></div></blockquote></div><br></div></div></div></blockquote></div><br></div>