Re: switching spline interpolation for Hovmoeller?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Apr 24 2013 - 10:54:34 MDT

Hi Kristina,

If you want to change the type of time labels used in plots, I recommend the very nice "time_axis_labels" function.

It uses various conversion functions like cd_convert and cd_calendar to create the desired labels, and it will set the various tmXXXX resources for you.

http://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml

We have some examples on the "time axis labels" examples page:

http://www.ncl.ucar.edu/Applications/time_labels.shtml

To use this function, it's import to load the following, after your other load commands at the top of your script:

load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"

--Mary

On Apr 24, 2013, at 3:42 AM, Kristina Fröhlich <kristina_froehlich@yahoo.de> wrote:

> Hi Mary,
>
> I tried now a proper time axis with attributes like
>
> Variable: otime
> Type: double
> Total Size: 960 bytes
> 120 values
> Number of Dimensions: 1
> Dimensions and sizes: [time | 120]
> Coordinates:
> time: [51453..55075.5]
> Number Of Attributes: 2
> units : days since 1850-01-01 00:00:00
> calendar : standard
>
>
> However, the I get on the time axis the days since 1850 which is not what I want.
> I tried to create my own tickmarks by converting the time with cd_calender into a variable called plot_date
>
> utc_date=cd_calendar(otime,-1)
> stime=72
> etime=108
> plot_date=utc_date(stime:etime)
>
> nTimeStride = 6 ; label every 6th time step
> res@tmYLMode = "Explicit"
> res@tmYLValues = plot_date(::nTimeStride)
> res@tmYLLabels = plot_date(::nTimeStride)
>
> But those values do not come up in the plot and there is no warning or error message. It just seems that the plot is ignoring the ressources. I am not sure If I mess up the values and Labels, but plot_date looks now simply like this
> (0) plot_date=199611
> (1) plot_date=199612
> (2) plot_date=199701
> ...
>
> Do I miss something?
>
> Kristina
>
>
> Von: Mary Haley <haley@ucar.edu>
> An: Kristina Fröhlich <kristina_froehlich@yahoo.de>
> CC: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Gesendet: 20:28 Dienstag, 23.April 2013
> Betreff: Re: [ncl-talk] switching spline interpolation for Hovmoeller?
>
> Hi Kristina,
>
> It's likely that you need to convert your time values to another format. If you have really large values, and then you try to use them as coordinates on an axis, NCL may have trouble trying to align them properly on the axis. I usually tell people to ignore the suggestion about adjusting "trYTensionF", and instead try rescaling their axis values if possible.
>
> I don't know what your time values look like, but look at the "cd_convert" function for converting them to different units.
>
> See the second example at:
>
> http://www.ncl.ucar.edu/Document/Functions/Contributed/cd_convert.shtml
>
> It shows how you can use this function to replace your existing time coordinate array.
>
> --Mary
>
> On Apr 23, 2013, at 9:26 AM, Kristina Fröhlich wrote:
>
> > Hello,
> >
> > is there a possibility to switch off the interpolation in a Hovmoeller plot? Since I catted together several forecasts I cause jumps in the timeseries and NCL is complaining about the spline approximation (at least for the model data):
> >
> > warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for Y axis failed: consider adjusting trYTensionF value
> > warning:IrTransInitialize: error creating spline approximation for trYCoordPoints; defaulting to linear
> >
> > I tried to change the tension value but without any effect. However, I would prefer not to have any spline in order not to fake a smooth transition where there is no one (see attached figure). But I found no example how to do this...
> >
> > Any ideas around?
> >
> > Thanks in advance, Kristina
> >
> >
> > <hov.png>_______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Apr 24 10:54:43 2013

This archive was generated by hypermail 2.1.8 : Fri Apr 26 2013 - 17:10:25 MDT