[ncl-talk] Fwd: Pressure vs. height of temperature - warning:IrTransInitialize: trXCoordPoints contains invalid coordinate array: defaulting trXAxisType to LinearAxis

Adam Phillips asphilli at ucar.edu
Mon Aug 5 10:15:36 MDT 2019


Hi David,
I would explicitly set the the X-axis labels, as opposed to altering the
time coordinate variable. The error messages are likely because your new
time coordinate variable values are very irregular and each set of 4 is
close together, and NCL is having trouble plotting it. Instead of this:
temp&tim = cd_calendar(tim,-3)
do this:
time_labels = cd_calendar(tim,-3)

then add this to your resource list:
  res at tmXBMode = "Explicit"
  res at tmXBValues = tim(0::4)    ; alter these settings
  res at tmXBLabels = time_labels(0::4)  ;  as you wish

I've attached a modified script and the resulting plot.
If you have any further questions let ncl-talk know.
Adam




On Mon, Aug 5, 2019 at 6:03 AM David Warner via ncl-talk <ncl-talk at ucar.edu>
wrote:

> Dear NCL users,
>
> I am using gsn_csm_pres_hgt to draw pressure vs. height plot. My time axis
> values are ranging from [1024536..1024638], however I would like to replace
> them in the following date format 2017120100 (YMDH).  I tried using
> "cd_calendar (tim,-3)" to make the date conversion. But I encounter the
> following error when I tried to plot:
>
> warning:IrTransInitialize: trXCoordPoints contains invalid coordinate
> array: defaulting trXAxisType to LinearAxis
> warning:_NhlCreateSplineCoordApprox: Attempt to create spline
> approximation for X axis failed: consider adjusting trXTensionF value
> warning:_NhlCreateSplineCoordApprox: Attempt to create spline
> approximation for X axis failed: consider adjusting trXTensionF value
> warning:_NhlCreateSplineCoordApprox: Attempt to create spline
> approximation for X axis failed: consider adjusting trXTensionF value
> fatal:IrTransInitialize: spline coordinate approximation not possible:
> fatal:Unable to initialize layer-Can't Create
> fatal:ContourPlotInitialize: Error creating transformation object
> fatal:ContourPlotInitialize: error setting up transformation
> fatal:Unable to initialize layer-Can't Create
> fatal:Unable to access object with id:-4
> fatal:PID #-4 can't be found in NhlSetValues
> fatal:NhlGetValues:PID #-4 is invalid
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 2212 in
> file /usr/local/ncl-6.6.2/lib/ncarg/nclscripts/csm/gsn_code.ncl
>
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 10216 in
> file /usr/local/ncl-6.6.2/lib/ncarg/nclscripts/csm/gsn_code.ncl
>
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 13414 in
> file /usr/local/ncl-6.6.2/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 13553 in
> file /usr/local/ncl-6.6.2/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 13832 in
> file /usr/local/ncl-6.6.2/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 39 in
> file warm_core.ncl
>
> I am attaching my script and the test figure(without making the date
> conversion). How to rectify this error to assign the desired time axis
> along x-axis?
>
> *; print output:*
>
> Variable: f
> Type: file
> filename: tanom
> path: tanom.nc
>    file global attributes:
>       history : PyFERRET V7 (opt)  5-Aug-19
>       Conventions : CF-1.6
>    dimensions:
>       LV_ISBL0 = 46
>       bnds = 2
>       TAX = 18  // unlimited
>    variables:
>       float LV_ISBL0 ( LV_ISBL0 )
>          units : pa
>          long_name : Isobaric surface
>          point_spacing : uneven
>          axis : Z
>          bounds : LV_ISBL0_bnds
>          standard_name : altitude
>
>       float LV_ISBL0_bnds ( LV_ISBL0, bnds )
>
>       double TAX ( TAX )
>          units : hours since 1901-01-15 00:00:00
>          axis : T
>          calendar : GREGORIAN
>          time_origin : 15-JAN-1901
>          standard_name : time
>
>       double ANM ( TAX, LV_ISBL0 )
>          missing_value : -9.999999999999999e+33
>          _FillValue : -9.999999999999999e+33
>          long_name : TEMP[D=1,X=74.2,Y=8.7]-T_REF
>          long_name_mod : X=61.5E:86.5E, Y=3.9S:21.1N
>
>
>
> Variable: tim
> Type: double
> Total Size: 144 bytes
>             18 values
> Number of Dimensions: 1
> Dimensions and sizes: [TAX | 18]
> Coordinates:
>             TAX: [1024536..1024638]
> Number Of Attributes: 5
>   units : hours since 1901-01-15 00:00:00
>   axis : T
>   calendar : GREGORIAN
>   time_origin : 15-JAN-1901
>   standard_name : time
> (0) 1024536
> (1) 1024542
> (2) 1024548
> (3) 1024554
> (4) 1024560
> (5) 1024566
> (6) 1024572
> (7) 1024578
> (8) 1024584
> (9) 1024590
> (10) 1024596
> (11) 1024602
> (12) 1024608
> (13) 1024614
> (14) 1024620
> (15) 1024626
> (16) 1024632
> (17) 1024638
>
> Variable: temp
> Type: double
> Total Size: 5760 bytes
>             720 values
> Number of Dimensions: 2
> Dimensions and sizes: [tim | 18] x [lev | 40]
> Coordinates:
>             tim: [2017120100..2017120506]
>             lev: [100000..5000]
> Number Of Attributes: 5
>   units : K
>   missing_value : -9.999999999999999e+33
>   _FillValue : -9.999999999999999e+33
>   long_name : Temperature Perturbation
>   long_name_mod : X=61.5E:86.5E, Y=3.9S:21.1N
>
>
> Variable: tim (coordinate)
> Type: double
> Total Size: 144 bytes
>             18 values
> Number of Dimensions: 1
> Dimensions and sizes: [tim | 18]
> Coordinates:
> Number Of Attributes: 5
>   calendar : GREGORIAN
>   units : hours since 1901-01-15 00:00:00
>   axis : T
>   time_origin : 15-JAN-1901
>   standard_name : time
> (0) 2017120100
> (1) 2017120106
> (2) 2017120112
> (3) 2017120118
> (4) 2017120200
> (5) 2017120206
> (6) 2017120212
> (7) 2017120218
> (8) 2017120300
> (9) 2017120306
> (10) 2017120312
> (11) 2017120318
> (12) 2017120400
> (13) 2017120406
> (14) 2017120412
> (15) 2017120418
> (16) 2017120500
> (17) 2017120506
>
>
> Thanks and regards.
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk



-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190805/b960b27f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: warm_core.mod.ncl
Type: text/x-ncl
Size: 1189 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190805/b960b27f/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.png
Type: image/png
Size: 304761 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190805/b960b27f/attachment-0001.png>


More information about the ncl-talk mailing list