Additional Date Format Option

Have a suggestion for improving DPlot or a question about existing features? Let us know

Moderator: DPlotAdmin

Post Reply
jgmiles
Posts: 14
Joined: Fri Dec 19, 2003 4:17 am
Location: Salt Lake City, Utah

Additional Date Format Option

Post by jgmiles »

Mr. Hyde,

Is it possible to add a date option that doesn't depend on the Microsoft Excel date system serial number format (and the concommitant programming requirements for conversion)? In my numerical weather model work, the dates are often output as YYYYMMDDTTTT to allow for alphabetic sorting/animations.

Is it possible to add a number format that accepts the YYYYMMDDTTTT format (e.g., 200312191830 to represent Dec 19, 2003 @ 18:30 universal time [i.e., a 24 hour clock]) with equidistant spacing between the dates/times?

Since numerical weather forecasts can be either an hour to hour format, a day to day format, a month to month format, or even a year to year format for climate forecasts, it would be nice if the program automatically truncated the extra unnecessary data in the date format as well. For example, YYYY would display only the year, without displaying the month/day/time (which would all be zeros). YYYYMM would display only the year and month--truncating the extra possible info (DDTTTT), etc., when displayed on the graph.

If I'm missing something obvious or a possible work around (all of which are quite possible!) let me know.

John
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

John,
Off the top of my head I can't think of a good reason not to do this... except precision might be a problem even though everything has been switched to double-precision. I'll try a few things to make sure this isn't a dead end and give a better answer later on.

Worst case I could write a file import plugin to translate your date/time strings to Excel serial dates before passing to DPlot.
Visualize Your Data
support@dplot.com
jgmiles
Posts: 14
Joined: Fri Dec 19, 2003 4:17 am
Location: Salt Lake City, Utah

Post by jgmiles »

David,

Thanks for your quick reply.

Just a thought (feel free to tell me to bug off if I'm making requests that you think are over the top :oops: )--for those of us who deal with time series a great deal, it would be nice to have a way to internally deal with dates in a more convenient format than presently available, rather than always having to import through a plug-in (I certaily wouldn't want to discourage you from the plug-in option if that is the most feasible for you.); i.e., it would be nice if temporal data on the X-axis could be imported via the clipboard, with manipulation within the program as to date display.

Ultimately, it would be nice to add time formats (e.g. 8 p.m., 8:30 p.m., 20:00, 20:30 etc.) to the current date format options. I assume there are more scientific disciplines that make extensive use of time series than just the atmospheric sciences, and a user-friendly way to deal with the data within the program would sure be nice.

John
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Looks like double precision will work fine, at least in the few examples I tried. Your example (200312191830) is distinguishable from 200312191831, which is what concerned me. For that matter there's still enough precision for seconds as fractional minutes in the few examples I looked at. I'll try to get this into an update before too long.

Times: Currently DPlot uses your Windows settings (set with Control Panel). But I agree, this should be only a default setting that you can change.

And please don't ever be concerned about over the top requests. All requests, no matter how crazy, are considered :D.
Visualize Your Data
support@dplot.com
jgmiles
Posts: 14
Joined: Fri Dec 19, 2003 4:17 am
Location: Salt Lake City, Utah

Post by jgmiles »

...it would be nice if the program automatically truncated the extra unnecessary data in the date format as well. For example, YYYY would display only the year, without displaying the month/day/time (which would all be zeros). YYYYMM would display only the year and month--truncating the extra possible info (DDTTTT), etc., when displayed on the graph.
I guess I should add that it would be nice to do the reverse--i.e., display only the time (TTTT), DDTTTT, etc.

Thanks,
John
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

I think I have this working reasonably well now (my machine only, at the moment). In general DPlot will use the date format and the (new) time format entries on the Number Formats dialog. Exceptions: If the year is 0, then the year isn't displayed. If the month and day are also 0, then only the time is displayed. At the other end, time will always be displayed according to the specified time format. If you don't want to display the time, just blank out the time format string.

One obvious thing I overlooked initially is the scaling. As is right now, 200312260000 will be scaled as if it is 7641 minutes greater than 200312252359, for example. So this isn't quite as simple as the other number formats, which don't effect the scaling in any way. Internally everything will be scaled by the equivalent Excel serial date. I'll most likely have this fixed by the end of the weekend and post a beta version to play with.
Visualize Your Data
support@dplot.com
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

John,
Please take a look: http://www.dplot.com/forums/viewtopic.php?t=43

Any comments you have are certainly welcome.
Visualize Your Data
support@dplot.com
jgmiles
Posts: 14
Joined: Fri Dec 19, 2003 4:17 am
Location: Salt Lake City, Utah

Post by jgmiles »

Appreciate your time & effort. I'll play for awhile and see how things go. :)

--John
jgmiles
Posts: 14
Joined: Fri Dec 19, 2003 4:17 am
Location: Salt Lake City, Utah

Post by jgmiles »

In addition to performing the translation, this new command also sets the number format of the X axis to 'Date and Time' and your Time format string to something that DPlot deems appropriate. If, for example, your time formatting string is 'h:mm:ss tt' and the granularity of the input is 1 hour or greater, then DPlot changes the time format string to 'h tt'. If anyone thinks this automation is too intrusive, your comments are certainly welcome.
David,

I don't mind the initial automation of the number format process, but I need to be able to then change the date format & then have the graph open with the same format (it currently reverts to the automatic settings of the import algorithm when the graph is reopened).

Again, if I'm missing something, let me know.

--John
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

You haven't missed anything; that's a foulup. The date and time format are saved for Calendar Date, but I goofed on the new Date and Time format. This will be fixed next go-around. Thanks for pointing out the mistake.
Visualize Your Data
support@dplot.com
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

John - Fixed it: http://www.dplot.com/forums/viewtopic.php?t=43

Thanks again.
Visualize Your Data
support@dplot.com
Post Reply