Menu

time jumps animated?

Feedback
Anonymous
2016-11-03
2016-12-08
  • Anonymous

    Anonymous - 2016-11-03

    Hello! I am slowly getting the hang of it, but there's one thing I just can't find. Can time jumps be animated? Like where you say: core.gotoDate() or something and you will see the planets accelerate and decelerate so you land on exactly the right spot.

    I want to create a script where I want to show several interesting celestial events months or even years apart. I know I can just set the time to the next event and see the heavens skip, but all the other moves are so nicely animated. Moving through time in an animated fashion would be awesome.

    Is there a script, a plugin or a command for that?

    I found a snippet of code where one can gradually increase and decrease the speed of time, but that doesn't get me to the next event precisely enough.

     
  • gzotti

    gzotti - 2016-11-03

    No direct way I am aware of. You can make a loop increasing dates by hour, day, week etc. Or increase time rate every few moments, then run at your max. speed with a core.waitFor(<DATE>), and slow down again. Make sure to decelerate in time before your real target time though.

     
  • Alexander Wolf

    Alexander Wolf - 2016-11-04

    Please try use core.setTimeRate()

     
  • Anonymous

    Anonymous - 2016-11-04

    Thanks, gzotti. I figured as much. These gradual increases is how I do it now. So I'll tweak my skills in that department to jump as accurate as I can. Your swift reply is much appreciated.

    (by the way, would such a feature be considered for future releases?)

     
  • Anonymous

    Anonymous - 2016-11-04

    Thanks Alexander. Yeah, that's what I'm doing right now:

    // jump back into time
    for(t=-1; t>-500000; t=t*2)
    {
        core.setTimeRate(t);
        core.wait(0.2);
    }
    
    core.wait(3.3);
    
    for(t=-500000; t<0; t=t/2)
    {
        core.setTimeRate(t);
        core.wait(0.2);
    }
    

    And that lands me in the vicinity of the right moment. But I find myself constantly tweaking the core.wait() time to the hundreth of a second (or the multiplier in the loop) to get it right. Hence my question if it could be done more precise.

    Anyway, I for one would cheer such a feature in a future release. For what that's worth ;-)

     
  • qam1

    qam1 - 2016-12-04

    If you haven't figured something out by now

    It's best to slow down your jumps as you approach the date.

    For example if the next event date is a year (365 days) away. Jump in 30 days increments until you get to 3 months/90 days away, then jump in week (7 day) incriments till 3 weeks the jump days.

    This is easier to do if you use julian dates. You can jump to the next event, get the julian date, then jump back.

    Here's a script example (It's diesigned for my location in NE USA, you may have to change FOV 7 Direction)

    // Author: Qam1
    // Name: Opposition Carousel
    // License: Public Domain
    // Description: Oppositions 2017-2020
    // Version: 1.0
    //
    // Made on Stellarium 15.0

    //

    LabelMgr.deleteAllLabels();

    pfast = "+24 days";
    pmed = "+6 days";
    pslow = "+1 days";

    id = new Array(length= 50);
    ip = new Array(length= 50);

    id[1] = "2017-04-07T00:00:00"
    ip[1] = "Jupiter";
    id[2] = "2017-06-15T00:00:00"
    ip[2] = "Saturn";
    id[3] = "2017-07-09T00:00:00"
    ip[3] = "Pluto";
    id[4] = "2017-09-04T00:00:00"
    ip[4] = "Neptune";
    id[5] = "2017-10-19T00:00:00"
    ip[5] = "Uranus";
    id[6] = "2018-05-08T00:00:00"
    ip[6] = "Jupiter";
    id[7] = "2018-06-27T00:00:00"
    ip[7] = "Saturn";
    id[8] = "2018-07-12T00:00:00"
    ip[8] = "Pluto";
    id[9] = "2018-07-27T00:00:00"
    ip[9] = "Mars";
    id[10] = "2018-09-07T00:00:00"
    ip[10] = "Neptune";
    id[11] = "2018-10-23T00:00:00"
    ip[11] = "Uranus";
    id[12] = "2019-06-10T00:00:00"
    ip[12] = "Jupiter";
    id[13] = "2019-07-09T00:00:00"
    ip[13] = "Saturn";
    id[14] = "2019-07-14T00:00:00"
    ip[14] = "Pluto";
    id[15] = "2019-09-10T00:00:00"
    ip[15] = "Neptune";
    id[16] = "2019-10-28T00:00:00"
    ip[16] = "Uranus";
    id[17] = "2020-07-14T00:00:00"
    ip[17] = "Jupiter";
    id[18] = "2020-07-15T00:00:00"
    ip[18] = "Pluto";
    id[19] = "2020-07-20T00:00:00"
    ip[19] = "Saturn";
    id[20] = "2020-09-11T00:00:00"
    ip[20] = "Neptune";
    id[21] = "2020-10-13T00:00:00"
    ip[21] = "Mars";
    id[22] = "2020-10-31T00:00:00"
    ip[22] = "Uranus";

    core.setDate("2017-01-01T00:00:00", "local");
    StelMovementMgr.zoomTo(230, 1);

    core.moveToAltAzi(0, 180, 1);

    core.wait(2);

    i = 0

    while (i < 22)
    {

    sjd = core.getJDay();

    i = i + 1;

    LabelMgr.deleteAllLabels();

    // next event

    // Get current & next JD. This happens so fast you won't notcie

    core.setDate(id[i], "local");
    njd = core.getJDay();
    core.setJDay(sjd);
    diff = (njd - sjd)

    core.selectObjectByName(ip[i], pointer = true);

    // go!!!!

    j = sjd

    while (j < njd)
    {

    core.setDate(pslow);

    if (njd - j > 12)
    {
    core.setDate(pmed);
    }

    if (njd - j > 40)
    {
    core.setDate(pfast);
    }

    core.wait(.1)
    j = core.getJDay();

    } //j

    txt1 = LabelMgr.labelScreen(ip[i], 600, 10, false, 25, "#FF0000");
    LabelMgr.setLabelShow(txt1, true);

    dd = core.getDate("local");

    txt1 = LabelMgr.labelScreen(dd.substring(0,10), 600, 50, false, 25, "#FF0000");
    LabelMgr.setLabelShow(txt1, true);

    core.wait(3);

    sjd = core.getJDay();

    } // i

     
  • qam1

    qam1 - 2016-12-04

    Here's another simialr but more complex script example. This one does Venus' GE and different times of day..

    1) It's designed for the NE USA using USA daylight saving times rules. So you may have to adjust the hours if Venus isn't showing right.

    2) I switch the hour time from the old to the new when Venis is "underground"

    3) Not only does venus slow down as it approached GE, after it accelarates away slowy and then speeds up.

    // Author: Qam1
    // Name: Venus Greatest Elongations
    // License: Public Domain
    // Description: Venus Greatest Elongations
    // Version: 2.0
    //
    // Made on Stellarium 15.0

    //

    LabelMgr.deleteAllLabels();

    pfast = "+6 days";
    pmed = "+1 days";

    id = new Array(length= 50);
    it = new Array(length= 50);

    // go to 1st event

    sdate = "2016-09-06T21:00:00" // 1st date

    core.setDate(sdate, "local");

    core.selectObjectByName("Venus", pointer = true);
    StelMovementMgr.setFlagTracking(true);

    core.wait(1);

    i = 0

    id[1] = "2017-01-12T19:00:00"
    id[2] = "2017-06-03T04:45:00"

    id[3] = "2018-08-17T20:30:00"
    id[4] = "2019-01-06T07:00:00"

    id[5] = "2020-03-24T20:30:00"
    id[6] = "2020-08-13T04:30:00"

    id[7] = "2021-10-29T18:00:00"
    id[8] = "2022-03-20T05:00:00"

    id[9] = "2023-06-04T22:00:00"
    id[10] = "2023-10-23T05:00:00"

    while (i < 10)
    {

    sjd = core.getJDay();

    LabelMgr.deleteAllLabels();

    i = i + 1;

    // next event

    // this happens so fast you won't notcie

    core.setDate(id[i], "local");
    njd = core.getJDay();
    core.setJDay(sjd);
    diff = (njd - sjd)

    // go!!!!

    j = sjd

    au = 0

    while (j < njd)
    {

    core.setDate(pmed);

    core.wait(.1)
    j = core.getJDay();
    TR = njd - j; // Time remaining

    pData = core.getObjectPosition("Venus");
    alt = pData["altitude"];
    ill = pData["illumination"];

    if (alt < 0) // below ground
    {

    if (ill > 50)
    {
    core.setDate(pfast);
    core.setDate(pfast);
    }
    else
    {
    core.setDate(pmed);
    }

    au = au + 1

    if (au == 2) // switch over to hours of next event
    {

    d = core.getDate().substring(0,10);
    d = d + id[i].substring(10,20);
    core.setDate(d, "local");

    }

    }
    else
    {

    if (TR > 30 && TR < diff - 30) // 30 days
    {
    core.setDate(pmed);
    }

    if (TR > 45 && TR < diff - 45) // 45 days
    {
    core.setDate(pmed);
    }

    if (TR > 90 && TR < diff - 120) // not a typo, it takes Venus longer to "come up" so I want it slower
    {
    //core.setDate(pfast);
    }

    // slow before hit

    if (TR < 5) //5 days
    {
    core.wait(0.05);
    }

    if (TR < 3)
    {
    core.wait(0.05);
    }

    } // above ground

    } //j

    txt1 = LabelMgr.labelScreen(core.getDate("local"), 500, 100, false, 25, "#00FF00");
    LabelMgr.setLabelShow(txt1, true);

    core.wait(3);

    sjd = core.getJDay();

    } // i

     

    Last edit: qam1 2016-12-04
  • Anonymous

    Anonymous - 2016-12-08

    Wow, thanks! Very instructive for a relative newby like me :-)