SetDate does not work properly

Bug #1202637 reported by Ross on 2013-07-18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Alexander Wolf

Bug Description

This is the script that does not work:

for(i=0; i<199; i++)
   core.setDate("+ 2616 weeks sidereal");

In version 0.11.4 (32 bit, Windows 7 64 bit), it seems to work properly: the equatorial grid remains fixed on the screen while the time increases about 50 years every 0.2 seconds.

In version 0.12.1 (32 bit on Windows 7 64 bit), it does not work anymore: the equatorial grid starts spinning. Same script, two different behaviors.

In version 0.12.1RC1 (32bit, on Windows 7 64bit), the program crashes after few seconds.

I don't know if the correct behavior is for the 0.11.4 or the 0.12.1, but I need that the script works like the 0.11.4.

Is it a bug or did you change something? How can I rewrite my script in order to make it work like the 0.11.4 version?

P.S: if you change "2616 weeks" with "50 years" the script does not work in any version. It seems that the word "years" is not accepted by the interpreter.

Alexander Wolf (alexwolf) wrote :
Changed in stellarium:
status: New → Invalid
Alexander Wolf (alexwolf) wrote :

Stellarium 0.11.4 don't knows about Delta-T

Changed in stellarium:
status: Invalid → Opinion
Ross (rosario-ing) wrote :

Sorry, but I don't understand your reply. I read the manual, but I don't find the answer.

First of all, I want the equatorial grid not to spin when I add years, like in 0.11.4. I've tried with "true" or "false" as third parameter (Deta-T), but the equatorial grid continue spinning. Since"false" is the default option, why Stellarium 0.12.1 and 0.12.2RC1 behave differently from Stellarium 0.11.4? Even if I explicitly specify "false", I don't get the same behavior of Stellarium 0.11.4.

Second, the "years" word does not work in any version. How about that?

Third, how can change the script in order to add 50 years without making the equatorial grid to spin?

Thank you for your reply.

Alexander Wolf (alexwolf) wrote :

If you disable DeltaT correction via GUI (F2 -> Navigation) or config.ini then behavior 0.12.1/0.12.2 will be like 0.11.4 without changes of script. Similar behavior should be with "true" value for enableDeltaT attribute for core.setDate() but possible I broke it and I'll check it now. Also I'll add "year" string for setDate();

Ross (rosario-ing) wrote :

Thank you Alexander! Actually, I set to "No Delta-T correction" in the F2 window and now it works. But I need to do it work inside the script, so I think there is something wrong on the third parameter of setDate().

Ok for the "years" (always plural) keyword to be added to setDate().

Changed in stellarium:
status: Opinion → In Progress
importance: Undecided → Medium
Alexander Wolf (alexwolf) wrote :

I'm added support of "years" for core.setDate() function and added two new functions - core.getDeltaTAlgorithm() and core.setDeltaTAlgorithm():

Ross (rosario-ing) wrote :

Fantastic! Great job!

Alexander Wolf (alexwolf) wrote :

Oops... I found that we lost "month" for setDate() also - fixed it: (of course we use duration of Earth's mean tropical month and Earth's sidereal month).

Changed in stellarium:
milestone: none → 0.12.2
assignee: nobody → Alexander Wolf (alexwolf)
Ross (rosario-ing) wrote :

I'm testing the 0.12.2RC3, but it seems that core.setDate("+2 years") adds not exactly 2 years, in fact I see the time going forward and backward of 2 years +/- a few hours and minutes. Sometimes it changes the day of the year.
This is the code I'm using:

while (true)
  core.setDate("+ 2 years");

I expect that only the year is to be changed.

I also add the "sidereal" option to setDate, but in this case the time added is 2 years +/- 12 hours...

For example, the sequence with the sidereal option becomes:
July 31, 2013 10:30:25
July 31, 2015 22:30:25
July 31, 2017 10:30:25
July 31, 2019 22:30:25

I've also disabled the DeltaT correction with core.setDeltaTAlgorithm("WithoutCorrection"), but the behavior is the same.

Alexander Wolf (alexwolf) wrote :

Partially you can solve this issue via update sidereal year duration of Earth in ssystem.ini file.

Changed in stellarium:
status: In Progress → Fix Committed
Changed in stellarium:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers