From: Derrick S. <Der...@no...> - 2005-05-17 18:32:37
|
Hi all, I'm new to matplotlib and trying to adapt some of the examples to my own data. Most of the time I read data from a netcdf file using the Scientific.IO.NetCDF module. When I read a time variable it usually has a units attribute that looks something like "days since 1900-01-01 00:00:00 -5". The units of measurement (here it was days) can be hours, seconds, weeks, whatever. Most of the examples in the mpl examples directory that deal with dates, start with the time information already parsed into year, month, day etc and then they create a datetime instance. Any pointers on parsing a serial date like the one I have into year, month, day in a somewhat general way? I currently use a package (cdat) which doesn't compile on Windows yet and I need a windows and unix solution. Finally, I find the documentation for datetime.timedelta to be pretty sparse. I was trying to construct a datetime sequence using matplotlib.dates.drange which had a monthly timestep. delta = datetime.timedelta(months=1) didn't seem to work. I tried a few variations on this to no avail. Thanks for any suggestions. Derrick |