<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div>Hi Jake, <div class=""><br class=""></div><div class="">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" class="">gc_inout</a> to find which grid points are actually within your circle. <div class=""><br class=""></div><div class="">e.g. (not tested, always test and double check)</div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Andale Mono" class="">;; Make lat and lon a 2d grid </font></div><div class=""><font face="Andale Mono" class="">lat2d = conform( <span style="font-size: 11px;" class=""> newTRMMyearly,</span></font><span style="font-family: 'Andale Mono'; font-size: 11px;" class="">newTRMMyearly&lat,</span><span style="font-size: 11px; font-family: 'Andale Mono';" class=""> 0) ; coord names may not be correct </span></div><div class=""><font face="Andale Mono" class="">lon2d = conform( <span style="font-size: 11px;" class=""> </span><span style="font-size: 11px;" class="">newTRMMyearly,</span></font><span style="font-family: 'Andale Mono'; font-size: 11px;" class="">newTRMMyearly&lon,</span><span style="font-size: 11px; font-family: 'Andale Mono';" class=""> 1)</span></div><div class=""><span style="font-size: 11px;" class=""><font face="Andale Mono" class=""><br class=""></font></span></div><div class=""><span style="font-size: 11px;" class=""><font face="Andale Mono" class="">in_circle = gc_inout( lat2d, lon2d, clat, clon)</font></span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 11px;" class="">newTRMMyearly = where( in_circle, </span><span style="font-size: 11px;" class="">newTRMMyearly, </span><span style="font-size: 11px;" class="">newTRMMyearly@_FillValue) ; mask points out of circle</span></font></div><div class=""><span style="font-size: 11px;" class=""><font face="Menlo" class=""><br class=""></font></span></div><div class=""><span style="font-size: 11px;" class=""><font face="Menlo" class=""><br class=""></font></span></div><div class="">set gsnAddCyclic = False and you should be able to plot the grid on a map. </div><div class=""><br class=""></div><div class="">Good luck,</div><div class=""> </div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>Alan</div><div class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""><br class=""></span></font></div><div class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""><br class=""></span></font><div><blockquote type="cite" class=""><div class="">On Aug 13, 2017, at 2:43 PM, Jake Huff <<a href="mailto:jake.huff@stonybrook.edu" class="">jake.huff@stonybrook.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello,<div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">;Snippet of code </div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">obtracks = addfile("<a href="http://allstorms.ibtracs_wmo.v03r05.nc/" class="">Allstorms.ibtracs_wmo.v03r05.nc</a>","r") ;Read in IBTrACS</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">lat_wmo = short2flt(obtracks->lat_wmo) ;(storm,time)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">lon_wmo = short2flt(obtracks->lon_wmo) ;(storm,time)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""><span style="font-variant-ligatures:no-common-ligatures" class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">; Read in Precipitation Files</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""><span style="font-variant-ligatures:no-common-ligatures" class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">precipfile = addfile("TRMMdata.nc","r")</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">AvgYearlyTRMM = precipfile->AvgYearlyTRMM ;(time,lat,lon)</span></div></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">clat = new(61,float)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">clon = new(61,float)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">radius = 5.0</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class="">lat_location = lat_wmo(0,0) ; location for 1st TC and time step<br class=""><span style="font-variant-ligatures:no-common-ligatures" class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">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;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">nggcog(lat_location,lon_location,radius,clat,clon) ;calculate circle</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">min_lat = min(clat)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">max_lat = max(clat)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">min_lon = min(clon)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">max_lon = max(clon)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""><span style="font-variant-ligatures:no-common-ligatures" class=""></span></div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""></span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">newTRMMyearly = AvgYearlyTRMM(0,{min_lat:max_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;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><span style="font-family:arial,sans-serif;font-size:small" class="">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'm using the min/max of the circle.</span><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">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't work. <br class=""></div><br class=""><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">Thanks for any help.</div><div style="margin: 0px; line-height: normal;" class="">Jake</div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> </span></p></div></div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""></div></div></body></html>