[ncl-talk] Problem with x coordinate when using gsn_csm_contour

xiaoming Hu yuanfangcan at hotmail.com
Tue Nov 26 15:47:43 MST 2019


I met a similar issue, but this time adjusting "trXTensionF " would not work any more.

I have to remove xcoordinate to make the script to plot  gsn_csm_contour
  delete(pt!1)
  delete(pt&time_vertical)
But the the countour plot seems weird, particularly for angle 1-3,
is there anyway to plot without deleting the x-coordinate?
I attached my script and data.
Thanks
Xiao-Ming Hu
[cid:dfc0c3bd-5924-49e5-ad0c-3997e82c3a0f]



________________________________
From: xiaoming Hu <yuanfangcan at hotmail.com>
Sent: Monday, November 4, 2013 9:31 PM
To: David Brown <dbrown at ucar.edu>
Cc: Xiaoming Hu <xhu at ou.edu>
Subject: RE: [ncl-talk] Problem with x coordinate when using gsn_csm_contour

Hello Dave

Thanks a lot. It indeed solved the problem following your instruction!

Have a good evening
Xiaoming

________________________________
Subject: Re: [ncl-talk] Problem with x coordinate when using gsn_csm_contour
From: dbrown at ucar.edu
Date: Mon, 4 Nov 2013 18:14:06 -0700
CC: ncl-talk at ucar.edu
To: yuanfangcan at hotmail.com

Hi Xiaoming,
You data does have some discontinuities (between time steps 17 and 18, also between 36 and 37) which is why NCL is having trouble generating a continuous time axis. However, in this case, If you follow the suggestion given by the warning message, you can get it to work. I set trXTensionF to 9.0 and I got a valid plot. You might also want to set gsnXIrregularToLinear to True depending on what your goal is.   If you data had bigger holes
you probably could not use trXTensionF. In that case you might need to generate some reasonably spaced intermediate pseudo coordinates values with fill values for the data values.
 -dave


On Nov 4, 2013, at 2:08 PM, xiaoming Hu <yuanfangcan at hotmail.com<mailto:yuanfangcan at hotmail.com>> wrote:

Hello

When I plot using
"plot  = gsn_csm_contour(wks, species_value(:,:), res1 ) "
I got the following warning
"
warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF value
warning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear
"

The resulted figure (attached below) is also wrong
See:

The x coordinate is supposed to be
(0)    0.8172222222222222
(1)    1.8175
(2)    2.8175
(3)    3.817777777777778
(4)    4.818055555555556
(5)    5.818333333333333
(6)    6.818611111111111
(7)    7.819166666666667
(8)    8.819166666666666
(9)    9.819444444444445
(10)    10.81972222222222
(11)    11.82
(12)    12.82027777777778
(13)    13.82027777777778
(14)    14.82
(15)    15.82
(16)    16.82
(17)    17.82083333333333
(18)    25.2144444444566
(19)    26.21277777774958
(20)    27.21277777774958
(21)    28.21305555553408
(22)    29.21305555553408
(23)    30.21305555553408
(24)    31.21333333331859
(25)    32.2138888888876
(26)    33.2138888888876
(27)    34.2141666666721
(28)    35.2141666666721
(29)    36.21472222224111
(30)    37.21500000002561
(31)    38.21500000002561
(32)    39.21500000002561
(33)    40.21472222224111
(34)    41.21472222224111
(35)    42.21500000002561
(36)    43.21527777775191
(37)    47.79083333333256

But ncl seemed to have 0-37 as x coordinate.



Thanks a lot
Xiaoming

_______________________________________________
ncl-talk mailing list
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/20191126/d00a839c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 380043 bytes
Desc: image.png
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191126/d00a839c/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20180502_lv2_PROF_JORD.nc
Type: application/x-netcdf
Size: 1891596 bytes
Desc: 20180502_lv2_PROF_JORD.nc
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191126/d00a839c/attachment-0001.nc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot_timeHeightNYmwr_4Profiles_potentialTemp.ncl
Type: application/octet-stream
Size: 13168 bytes
Desc: plot_timeHeightNYmwr_4Profiles_potentialTemp.ncl
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191126/d00a839c/attachment-0001.obj>


More information about the ncl-talk mailing list