Time Variables

From: Don Morton <donaldjmorton_at_nyahnyahspammersnyahnyah>
Date: Mon, 4 Jun 2007 11:31:41 -0600

Howdy, I'm still learning more NCL and having a great
time!

Question on time variables, in the form of a simple example
case - I want to plot station temperatures from a 48-hour
forecast - temperature on y-axis, time on x-axis. These
temperatures are typically available at 3-hr intervals. On the
same graph I want to plot the observed temperature for the
station, and these are typically available hourly (sometimes
more frequently) at 53 minutes past the hour.

To do this in Excel is somewhat easy - just parse the timestamp
into a "time" variable (which is typically just some number representing
the time since some "Epoch"), then Excel takes care of the
rest (converting the time variable to a human-readable date/time).

I've been looking for something analogous in NCL, and the closest
thing I've stumbled on is using ut_inv_calendar() to take a timestamp
and parse it into year, month, etc. and convert to a number representing
time since some Epoch (it appears that "I" choose the Epoch in this
case). Then, I can use ut_calendar() to take that number later and
convert it to the numeric components of a timestamp. So far, this is
logical, and experimentation has convinced me I can make it work.

The only issue I have is that when I actually want to plot this stuff, how
can I format the labels on the x-axis so they're in human readable form?
I realize that I can create some sort of "map" (as I've seen in a couple
of your examples) that would translate the timestamp components to
whatever format I want, and then use this for my labels. Is this the
recommended way to do things? In Excel, of course, I could just
specify the formatting I wanted and it would be done automatically,
but I don't see that capability in NCL. No big deal, but being the
lazy kind of person I am, I want to make sure I'm not missing something
and making things much harder than they need to be :)

Thanks,

Don Morton

-- 
Arctic Region Supercomputing Center
http://weather.arsc.edu/
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 04 2007 - 11:31:41 MDT

This archive was generated by hypermail 2.2.0 : Thu Jun 14 2007 - 09:39:54 MDT