[ncl-talk] Subsetting a circle of data
Jake Huff
jake.huff at stonybrook.edu
Sun Aug 13 12:43:24 MDT 2017
Hello,
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.
;Snippet of code
obtracks = addfile("Allstorms.ibtracs_wmo.v03r05.nc","r") ;Read in IBTrACS
lat_wmo = short2flt(obtracks->lat_wmo) ;(storm,time)
lon_wmo = short2flt(obtracks->lon_wmo) ;(storm,time)
; Read in Precipitation Files
precipfile = addfile("TRMMdata.nc","r")
AvgYearlyTRMM = precipfile->AvgYearlyTRMM ;(time,lat,lon)
clat = new(61,float)
clon = new(61,float)
radius = 5.0
lat_location = lat_wmo(0,0) ; location for 1st TC and time step
lon_location = lon_wmo(0,0) ; location for 1st TC and time step
nggcog(lat_location,lon_location,radius,clat,clon) ;calculate circle
min_lat = min(clat)
max_lat = max(clat)
min_lon = min(clon)
max_lon = max(clon)
newTRMMyearly = AvgYearlyTRMM(0,{min_lat:max_lat},{min_lon:max_lon}) ;reads
in square of data
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.
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.
Thanks for any help.
Jake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170813/17db09ee/attachment.html
More information about the ncl-talk
mailing list