Reversed "astro" function

Have a QScript to share, or need help with programming? Post your comment here.
Post Reply
en1940
Posts: 18
Joined: Sun Nov 22, 2015 5:41 pm
Location: Homeless
Contact:

Reversed "astro" function

Post by en1940 » Sun Mar 25, 2018 3:51 pm

Hi folks!

what would be best way to reverse "astro" function?

for example - I want to use as input: mercury, geo, location values, longitude value, etc, etc
and get back array of dates and times when mercury is at position with longitude equal to input value....

Any ideas?

Regards,
Ev

sbank
Posts: 174
Joined: Tue Jul 21, 2015 9:35 pm
Contact:

Re: Reversed "astro" function

Post by sbank » Mon Mar 26, 2018 4:08 pm

Hi Ev,

I am not sure I understand what you mean by "input value." You can just do a simple plot of something like this:

Code: Select all

wave_long = astro(year, month, day, time, astro_mercury, true, astro_long , true);
plot1 = wave_long;   
Then when applied to a daily chart, you can see the jump when going retrograde. But I don't think this is really what you are looking for...

Mercury.png
Mercury.png (27.25 KiB) Viewed 14916 times

en1940
Posts: 18
Joined: Sun Nov 22, 2015 5:41 pm
Location: Homeless
Contact:

Re: Reversed "astro" function

Post by en1940 » Mon Mar 26, 2018 5:05 pm

Big pardon for broken english )

I need to know date and time when helio Merc is 237.35 degrees (for example) to draw trendlines backwards from there
Last edited by en1940 on Mon Mar 26, 2018 5:32 pm, edited 1 time in total.

User avatar
earik
Site Admin
Posts: 474
Joined: Mon Dec 01, 2014 12:41 pm
Contact:

Re: Reversed "astro" function

Post by earik » Mon Mar 26, 2018 5:21 pm

Hi Ev,

You're asking for an aspectarian. That's sort of what the ephemeris does in the panel on the right. But to do it from a chart, you'd have to write a script to solve for the aspects you were looking for, then spit that information out to a file or the print log. It would involve setting up a loop, sort of like this:

Code: Select all

if (barnum == barsback) {

# use julian days for a loop. this example goes from the year 2000 to 2020
jd1 = julianday(2000,1,1,1200);
jd2 = julianday(2020,1,1,1200);

old_mercury = 0; # holds previous value of mercury
mercury = astro(2000,1,1,1200,astro_mercury,true,astro_rd,true);; # holds current value of mercury
aspect_to_find = 237.35;

for (jd = jd1 to jd2) {
   y = julian_to_year(jd);
   m = julian_to_month(jd);
   d = julian_to_day(jd);

   old_mercury = mercury;
   mercury = astro(y,m,d,1200,astro_mercury,true,astro_rd,true);
  
   # look for the conditions
   have_an_aspect = false;
   if ((mercury >= aspect_to_find) and (old_mercury < aspect_to_find)) #direct motion trigger
      have_an_aspect = true;
   if ((mercury <= aspect_to_find) and (old_mercury > aspect_to_find)) #retrograde motion trigger
      have_an_aspect = true;

   #if we have a hit, record it somewhere
   if (have_an_aspect == true) 
      print("Aspect on ",y," ",m," ",d);
}

}

plot1= close; # put this in there so you know when you're done
I just wrote that off the top of my head to give you a starting point, so there might be typos in there, but it should be pretty close. Basically, you are using an indicator to run a loop where you search for your aspects. It's going to take some time, so you only want to do it once, which is why I stuffed it all inside the "if (barnum == barsback)" section.

It's not exactly what QScript was meant for, which is why it can be a little clunky, but it's definitely doable.

Hope that helps.

Earik

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests