Re: time axis annotation

From: Jeff Whitaker <jswhit_at_nyahnyahspammersnyahnyah>
Date: Thu, 20 Mar 2008 19:17:08 -0600

Mary Haley wrote:
>
> Hi Jim,
>
> I'm trying to come up with a udunits example, but having difficulty
> finding the "netcdftime" module you mentioned. Is there some
> documentation for it?

Mary: It's part of my netcdf4-python module
(http://code.google.com/p/netcdf4-python/source/browse/trunk/netcdftime/netcdftime.py),
although it's just a single python file (no C code), so it's easy to
extract and use separately. It can do conversions between python
datetime objects and any of the time coordinates/calendars covered in
the CF standard. Feel free to include it in PyNGL if you wish.

-Jeff
>
> I did see another module "nc" that mentions udunits, but I didn't
> see documentation about how to convert the time values to other units.
>
> I'm tempted to try wrapping our own "ut_calendar" function that
> we have in NCL. See:
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/ut_calendar.shtml
>
> Anyway, I went ahead and created an example that shows how to
> label the time axis. I hard-coded the time-converted units for now (I
> did this from an NCL script using ut_calendar).
>
> The way I did the time axis may be meaningless, but hopefully it
> illustrates how to do this kind of thing. Let me know if you have
> other questions.
>
> If anybody out there knows of a python module for doing this kind of
> conversion, please let us know.
>
> --Mary
>
> On Tue, 18 Mar 2008, James Boyle wrote:
>
>> I have looked over the examples and documentation.
>> I do not find any direct support for a facility to label a time axis
>> with actual times.
>> For example. if I have a set of times, 1 , 2, 3 which are 'days since
>> 28 Feb 2006', I can get labels '28 Feb ', '1 Jan', '2 Jan'.
>>
>> I have the feeling that this is in the do-it-yourself category,
>> combining the datetime and time python modules but I figured I'd see
>> if there is anything I missed.
>> Probably, to accomodate model calendars one would also need Jeff
>> Whittaker's netcdftime module.
>> In any case some examples would be useful. More generalized than
>> ngl11p.py or meteogram.py.
>>
>> --Jim
>> _______________________________________________
>> pyngl-talk mailing list
>> pyngl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>>
> ------------------------------------------------------------------------
>
> _______________________________________________
> pyngl-talk mailing list
> pyngl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

-- 
Jeffrey S. Whitaker         Phone : (303)497-6313
NOAA/OAR/CDC  R/PSD1        FAX   : (303)497-6449
325 Broadway                Boulder, CO, USA 80305-3328
Received on Thu Mar 20 2008 - 19:17:08 MDT

This archive was generated by hypermail 2.2.0 : Tue Mar 25 2008 - 17:24:52 MDT