Re: tickmark labels for month

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri, 13 Oct 2006 07:51:36 -0600 (MDT)

This is a good discussion topic for ncl_talk.

Yes, "automatic time labelling" would be a nice feature.

but .....

A few rambling thoughts:

[0] I think NCL's *core* graphics can implement any labeling
    users might desire right now. I think you are asking for
    functions that are at the level of gsn_* and gsn_csm_*
    to implement automatic labeling.

[1] The gsn_csm* suite of graphical functions are templates
    that automate a particular style: a style used in a special
    issue of J. Climate focusing on the CCSM. Most people seem
    to like the style but some people don't. Yes, users can change
    the 'look' but then it is not automated. :-)

    EG: The Hovmueller plot below: "I would like major tickmarks at
    the 1st day of the month and minors every, say 5 days.
    Month names should be placed between the two adjacent
    tickmarks, thus around the 16-th day of the month."
    (I like it but others may not.) How would users like
    this automated?

[3] There are a number of functions in contributed.ncl:
       http://www.ncl.ucar.edu/Document/Functions/date.shtml
    which may help do what you want.

    eg: time = f->time ["hours/days since ..."]
           yr_frac = ut_calendar(time, 4) ; opt=4 returns yyyy.frac_of_year

    other functions that return the same values:
    yyyymm_to_yyyyfrac, yyyymmdd_to_yyyyfrac, yyyymmddhh_to_yyyyfrac

    These are often good for climate type x-axis plotting.

[4] The WRF model output does not adhere to the COARDS or CF netCDF
    conventions. The time variable used is of character type [ :-( ]
      http://www.ncl.ucar.edu/Applications/wrfnetcdf.shtml

    netcdf wrfout_d01_2003-07-13_12:00:00 {
    dimensions:
        Time = UNLIMITED ; // (4 currently)
        DateStrLen = 19 ;
    [snip]
    char Times(Time, DateStrLen) ; no meta data provided
    [snip]

    NCL does provide a function in WRF_contributed.ncl

    WRF_Times2Udunits_c(Times:character, opt)
    ; convert WRF character variable "Times" to udunits
; 2001-06-11_12:00:00
; convert WRF character variable "Times" to a coordinate variable "Time"
; opt can be "integer" or "string"
; . integer: opt = 0 : hours since initial time: Times(0,:)
; . opt = 1 : hours since 1901-01-01 00:00:00
; . string: opt = 'any udunits compatible string'
;
    ---
    
    Some requests that have been made:

         | | | | | .....
       Dec 1 Dec 2 .....
        00Z 12Z 00z .....
       2005 2005 .....

    or
         | | | | | .....
        00Z 12Z 00Z
      12/01/05 12/02/05

    etc

    How to automate? Users would have to convert to some
    standard [say, use ut_inv_calendar to convert to "... since ...]
    then provide some option 0, 1, 2, 3, ...., N
    that says plot with this type of look.

etcetera, etcetera, ....

D

On Fri, 13 Oct 2006, Saji Njarackalazhikam Hameed wrote:

> Takeshi and others,
>
>
> I agree that automatic time labelling is a very desireable feature in
> NCL. Since time co-ordinate, like other axes (such as latitude/longitude) is
> present in a NetCDF file, this should be theoretically possible.
> Practical limitations may come from the variety of time axis definitions
> (usage of different calendars etc). Right now I believe, udunits
> supports only one kind of calendar. Applications such as GrADS assume
> that the time information is always written using a standard calendar.
> This could give rise to problems when for example using a NetCDF file
> that writes time in terms of a 360 day calendar for example.
>
> In light of these limitations, I suggest that NCL may implement
> automatic time labelling, but a warning could be given when the NetCDF
> file does not conform to standards (same as gsn_csm_countour_map that
> complains when latitude is not written in degrees_north or other
> compatible units). I hope the NCL developers will consider some level of
> automation in the future.
>
> Now and then I have attempted to automate the drawing of the time axis.
> Attached with this is an example (index2.ncl) and associated procedures.
> The procedures are in the file "jeenie.module". I have two procedures,
> one that plots time axis in terms of years and another that plots in
> terms of months and years (for example Oct05). These are not well
> thought out algorithms, but just written to satisfy needs of the moment.
> Of course, I assume that time is written in the gregorian calendar (I
> usually preprocess my netcdf files and write time axis in a consistent
> way).
>
> Hope it is of some help...
>
> saji
>
>
>
>
> * Takeshi Enomoto <eno_at_jamstec.go.jp> [2006-10-02 11:27:39 +0900]:
>
> > Hello,
> >
> > I am drawing a Hovmoller diagram.
> > I would like to label month names along the Y axis.
> > I would like major tickmarks at the 1st day of the month
> > and minors every, say 5 days.
> > Month names should be placed between the two adjacent
> > tickmarks, thus around the 16-th day of the month.
> >
> > Denoting = as the major and - as the minor tickmarks,
> > it would be like,
> >
> > =
> > -
> > -
> > Oct -
> > -
> > -
> > =
> >
> > I was able to place labels at desired places by setting
> > tmYLMode, tmYLValues and tmYLLabels appropriately.
> > However, I was not able to have minor tickmarks since
> > I used them as major (thicker and longer) tickmarks and
> > hide majors by setting tmYLMajorLengthF = 0 and tmYLThicknessF = 0.
> > The result is
> >
> > =
> >
> >
> > Oct
> >
> >
> > =
> >
> > I would be glad if you direct me a better way or to direct me to an
> > example.
> >
> > It would be nice if ncl had a automatic labelling for the time axis
> > although I understand that it is not easy.
> >
> > Takeshi
> >
> > -----
> > Dr Takeshi Enomoto
> > eno_at_jamstec.go.jp
> > Earth Simulator Center, JAMSTEC
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk_at_ucar.edu
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Oct 13 2006 - 07:51:36 MDT

This archive was generated by hypermail 2.2.0 : Fri Oct 13 2006 - 10:37:11 MDT