[ncl-talk] Custom cross-sections in NCL
James Russell
jorussel at ncsu.edu
Thu May 18 07:14:15 MDT 2017
Hi all,
I'm attempting to plot a cross-section with height that traverses a line of
lat/lon points. The data set in is currently in pressure x lat x lon
coordinates. I'm using gc_latlon to create two vectors with the lat and lon
coordinates I need and then attempting to use linint2_points_Wrap to
interpolate to those points. This is similar to the narr_5.ncl example on
the Slices page. My issue is that linint2_points_Wrap needs both the xcoord
and ycoord to be monotonically increasing while I want to plot a
cross-section along a line that has latitude decreasing but longitude
increasing.
My script is below. With the current configuration, because the input
latitudes are monotonically decreasing, it outputs only missing values for
the result.
Can anyone help me with this? Is there a better way to go about creating
the slice? Or am I missing an obvious working around in my code?
Thanks,
James
lat1 = 12.
lat2 = 10.
lon1 = -15.
lon2 = 0.
preL = 1000.
preH = 200.
pathin = "/home/james/"
filein = "WRFNCLPP_V.nc"
npts = 30
;**********************************************************
; Create great circle vectors of lat/lon points
;**********************************************************
pts = gc_latlon(lat1,lon1,lat2,lon2,npts,-2)
;**********************************************************
; open file and read required data
;**********************************************************
print("Opening file and reading data")
f = addfile(pathin+filein,"r")
vwnd = f->V(1,{preL:preH},{lat1:lat2},{lon1:lon2})
;**********************************************************
; Interpolate to points on great circle
;**********************************************************
vwnd_xs = linint2_points_Wrap(vwnd&lon,vwnd&lat,vwnd, \
False,pts at gclon,pts at gclat,0)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170518/abda6d4a/attachment.html
More information about the ncl-talk
mailing list