RE: Problem with Time Axis

From: Flanders, Joel M. \(JSC-SF2\)[LM] <joel.m.flanders_at_nasa.gov>
Date: Fri, 2 Jun 2006 17:25:51 -0500


Hi Olivier,

I tried your suggestion, but it did not change my results.

I did, however, discover what the problem is. This problem is related to the switch from Standard Time to Daylight Savings Time. In my example, The x-axis runs from March 31 0:00 to April 2 12:00, and Daylight Savings starts on April 2 02:00 in the US. So, when the plot gets to 02:00 it jumps to 03:00 to compensate for Daylight Savings time, and this makes subsequent data points to be 1 hour later than it should be. I tried the same example, but the x-axis now runs from March 1 0:00 to March 3 12:00. In this case, there is no one hour jump. This example illustrates why you were unable to duplicate my problem. Since your daylight savings time started on March 26, when you run my macro you did not see the same result because it did not cause you to run across a time change boundary. I have included 2 attachments one named Mar31.gif that shows the plot with the x-axis starting on March 31 and Mar01.gif showing the plot with the x-axis starting on March 1. Maybe these pictures can help to illustrate what I have tried to explain here.

Thanks,
Joel

-----Original Message-----
From: Olivier Couet [mailto:Olivier.Couet_at_cern.ch] Sent: Thursday, June 01, 2006 2:45 AM
To: Flanders, Joel M. (JSC-SF2)[LM]; Bertrand Bellenot; Rene Brun Cc: roottalk (Mailing list discussing all aspects of the ROOT system) Subject: RE: [ROOT] Problem with Time Axis

Hi Joel,

May be you have a none empty rootlogon.C file in which you set some parameters changing the axis division behavior. To be sure the rootlogon.C content is not executed, start root with the option "-n" (root -n) and try your macro again. Let me know.

Olivier

-----Original Message-----
From: Flanders, Joel M. (JSC-SF2)[LM] [mailto:joel.m.flanders_at_nasa.gov] Sent: Wednesday, May 31, 2006 10:26 PM
To: Bertrand Bellenot; Rene Brun
Cc: Olivier Couet; roottalk (Mailing list discussing all aspects of the ROOT system)
Subject: RE: [ROOT] Problem with Time Axis

If I run the macro, I get the attached canvas which is clearly different from yours. I do not understand how I am getting different results. I need to understand what I am doing differently that is giving me different results.

Thanks,
Joel

-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch
[mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Bertrand Bellenot Sent: Friday, May 26, 2006 2:08 PM
To: Rene Brun
Cc: Flanders, Joel M. (JSC-SF2)[LM]; olivier.couet_at_cern.ch; roottalk_at_cern.ch
Subject: Re: [ROOT] Problem with Time Axis

Hi,

I don't see the problem with cvs head version of Root on Windows XP (see the saved (gif) canvas in attachment).

Cheers,
Bertrand.

Rene Brun wrote:
> Hi Joel,
>
> I cannot reproduce your problem on Linux and macosx.
> Olivier will investigate what happens on Windows as soon as he will be

> back on Monday.
>
> Rene Brun
>
>
> On Thu, 25 May 2006, Flanders, Joel M. (JSC-SF2)[LM] wrote:
>
>> I am using windows xp and ROOT version 5.11/02. I ran the following
>> macro:
>>
>> {
>> TDatime CurrentDate(2006,03,31,00,00,00); TGraph *gr7 = new TGraph();
>> gr7->SetPoint(0,0,0);
>> gr7->SetPoint(1,43200,1);
>> gr7->SetPoint(2,86400,2);
>> gr7->SetPoint(3,129600,3);
>> gr7->SetPoint(4,172800,4);
>> gr7->SetPoint(5,216000,5);
>> gr7->GetXaxis()->SetTimeOffset(CurrentDate.Convert(),"local");
>> gr7->GetXaxis()->SetTitle("Date");
>> gr7->GetXaxis()->SetTimeDisplay(1);
>> gr7->GetXaxis()->SetTimeFormat("#splitline{%m\/%d\/%y}{%H\:%M\:%S}");
>> gr7->GetXaxis()->SetLabelOffset(0.03);
>> gr7->GetXaxis()->SetNdivisions(508);
>> gr7->GetXaxis()->SetTitleOffset(1.7);
>> gr7->GetYaxis()->SetTitle("Y-Axis");
>> gr7->SetMarkerStyle(20);
>> gr7->Draw("ALP");
>> }
>>
>> I get a canvas with a time axis plot. The problem is for the first 2
>> days major axis divisions come every 12 hours, but during the
>> transition from day 2 to day 3 the first major division on day 3
>> comes 13 hours after the last one on day 2. After this it goes back
>> to 12 hours between major divisions. However this causes the endpoint

>> of the data to be 1 hour ahead of where it should be. Am I doing
>> something wrong here to cause this issue?
>>
>> I had a colleague who uses Linux (CentOS) test this on his
>> workstation, and he gets the same error.
>>
>> Thanks,
>> Joel Flanders
>>
>

Mar31.gif
Mar01.gif
Received on Sat Jun 03 2006 - 00:26:54 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:58 MET