[ncl-talk] Problem of using "get_isolines"
王淼
miaowang2015 at pku.edu.cn
Thu Jun 1 23:10:38 MDT 2017
Hi Mary,
I put the "pt_miao.nc"(just one month data) in the "incoming" folder , because I cannot see the list of this folder ,I'm not sure if I succeed .So I attached it , you can download for testing.
Hope this helps.
Miao
-----原始邮件-----
发件人:"Mary Haley" <haley at ucar.edu>
发送时间:2017-06-02 05:16:12 (星期五)
收件人: "王淼" <miaowang2015 at pku.edu.cn>
抄送: "ncl-talk at ucar.edu" <ncl-talk at ucar.edu>
主题: Re: [ncl-talk] Problem of using "get_isolines"
Hi,
We were looking into this problem using a different example, and seeing some odd results.
Is it possible for you to provide us with the pt.nc file?
You can use our ftp, if the file is not too large:
http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP
Thanks,
--Mary
On Tue, May 30, 2017 at 8:17 PM, 王淼 <miaowang2015 at pku.edu.cn> wrote:
Hi Ncl Talk,
I used get_isolines to get the points that define a contour line .When I printed the longitude of these points , the distribution of the longitude wasn't the same(gonna show in the following example) ,may be [0~-360] or [20~-340],etc. I have expected the function may return the longitude as [0~360] or [-180~180]. I googled it ,but didn't help.I still don't know what caused the effect, so I ask you for help. Thanks!
Here is the code and resluts:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"
begin
f1=addfile("pt.nc","r") ;pt(time,lat,lon)
pt=short2flt(f1->pt)
pt=lonFlip(pt) ;lon=0~360degrees
n=dimsizes(pt&time)
wks = gsn_open_wks("pdf","sypt_all")
res = True
res at gsnDraw = False
res at gsnFrame = False
res at cnFillOn = False
res at cnLinesOn = True
res at cnLevelSelectionMode = "ExplicitLevels"
res at cnLevels = (/350,360/)
res at mpMinLatF = 0
res at mpCenterLonF =180
res at trGridType = "TriangularMesh"
do i = 0, n-1 ;time
plot=gsn_csm_contour_map_ce(wks, pt(i,:,:), res)
isolines = get_isolines(plot at contour,"plot")
do j= 0, ListCount(isolines) - 1
iso := isolines[j]
idx=maxind(iso at n_points)
b = iso at start_point(idx)
e = b + iso at n_points(idx) - 1
y := iso(0,b:e)
x := iso(1,b:e) ;y=lat,x=lon
print(x)
end do
end do
end
| result1 | result2 |
| 0 | 0 |
| -1.8 | -1.3 |
| -2.5 | -2.5 |
| … | … |
| -358.9 | -339.8 |
| -359.7 | -340 |
| -360 | … |
| | 20 |
| | 18.6 |
| | … |
| | 2.5 |
| | 0.5 |
| | 0 |
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170602/94a098c8/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pt_miao.nc
Type: application/octet-stream
Size: 332176 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170602/94a098c8/attachment-0001.obj
More information about the ncl-talk
mailing list