Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

At last, Transits v1 #36

Merged
merged 34 commits into from
Dec 23, 2020
Merged

At last, Transits v1 #36

merged 34 commits into from
Dec 23, 2020

Conversation

lfborjas
Copy link
Owner

@lfborjas lfborjas commented Dec 23, 2020

Closes #1

There's been some work already introduced in #33 and #30, but the bulk is here:

  • We use a precalculated daily ephemeris, stored in a bundled sqlite DB with 16 years of data (~13Mb), for fast querying of likely activity of a given transit.
  • We use the Ridder's method of root finding to find the exact moment of transit in a given time range.
  • There's been a few numerical revelations, and shortcomings: the aforementioned activity and exactness finding functionality is blind to angles that "jump" from (359, 360] to [0,1).
  • In the new transits page, we now have some JS to localize dates and provide a link to "transits at the current moment" that, for the first time in this codebase, doesn't concern itself with old browsers; same with the markup: better use of more semantic tags like article, main and section.
  • Bonus: plain text versions of both the natal chart and transits endpoints! The only way to obtain it, currently, is via the Accept header (so only really through curl and friends,) but it's massively helpful for integration testing (easier to diff) and troubleshooting. Some dubious types were introduced here, so I'll surely iterate.

* Add the config entry
* Define the "omnibus" data type and function
* Skeleton of the actual "transit activity" function
Yet another tangent on our way to transits
Can ask for it with the `Accept: text/plain` header:

curl -vH "Accept: text/plain" "http://localhost:3000/full-chart?location=Your+Location&month=12&day=21&year=2020&hour=3&minute=18&day-part=pmz&lat=40.750284799999996&lng=-73.8787328"
* Note that the `exactAspectAngle` calculation may be off when close
  to 360/0!
* Also, should the orb be configurable?
Already found some issues:

* The 0/360 situation misses some aspects
* Need to make Transit a superset of Aspect
* `angularDifference` is wrong!
* The orb situation is more subtle than I thought! Maybe it should
  be proportional to the planets involved? Maybe we use the usual
  orbs and then filter down aspects based on heuristics?
Have to consider the "counter-angle". Bit of a duplication here.
Note that for a transit to be active, it has to be within 1 degree.
based on the "alternate styles" in astro-seek:

https://horoscopes.astro-seek.com/calculate-transit-chart/?send_calculation=1&muz_narozeni_den=1&muz_narozeni_mesic=1&muz_narozeni_rok=1970&muz_narozeni_hodina=00&muz_narozeni_minuta=00&muz_narozeni_sekunda=00&muz_narozeni_city=&muz_narozeni_mesto_hidden=Manually+place%3A+%C2%B0%27N%2C+%C2%B0%27E&muz_narozeni_stat_hidden=XX&muz_narozeni_podstat_kratky_hidden=&muz_narozeni_podstat_hidden=&muz_narozeni_input_hidden=&muz_narozeni_podstat2_kratky_hidden=&muz_narozeni_podstat3_kratky_hidden=&muz_narozeni_sirka_stupne=0&muz_narozeni_sirka_minuty=0&muz_narozeni_sirka_smer=0&muz_narozeni_delka_stupne=0&muz_narozeni_delka_minuty=0&muz_narozeni_delka_smer=0&muz_narozeni_timezone_form=auto&muz_narozeni_timezone_dst_form=auto&send_calculation=1&zena_narozeni_den=22&zena_narozeni_mesic=12&zena_narozeni_rok=2020&zena_narozeni_hodina=12&zena_narozeni_minuta=00&zena_narozeni_city=&zena_narozeni_mesto_hidden=Manually+place%3A+%C2%B0%27N%2C+%C2%B0%27E&zena_narozeni_stat_hidden=XX&zena_narozeni_podstat_kratky_hidden=&zena_narozeni_podstat_hidden=&zena_narozeni_input_hidden=&zena_narozeni_podstat2_kratky_hidden=&zena_narozeni_podstat3_kratky_hidden=&zena_narozeni_sirka_stupne=0&zena_narozeni_sirka_minuty=0&zena_narozeni_sirka_smer=0&zena_narozeni_delka_stupne=0&zena_narozeni_delka_minuty=0&zena_narozeni_delka_smer=0&zena_narozeni_timezone_form=auto&zena_narozeni_timezone_dst_form=auto&fortune_asp=on&hide_aspects=0&orb=3&house_system=placidus#tabs_redraw
Also, didn't need all those lenses, duh!
And show natal/transit positions in the transits page.
Should be usable in the natal chart page, too; though with more care:
I'm using a few JS features not available in IE. Works in FF,
Chrome and Safari tho.
Now the row is the transiting planet, for easier parsing!
Can be reused in natal chart page!
We were relying on some sorting that's not necessarily guaranteed.

Probably need to do a similar thing for the natal chart!
* Look for all possible aspects, with the default orbs
* Only draw exact aspects (looks a bit sparse!)
Only using this stuff in transits, as those are the only ones where
the aspecting body is guaranteed to be the fastest. For natal charts,
I'll probably need a "HasSpeed" class to generalize to axes.

What a difference coding in the morning makes!

This addresses #18, in part.

#18
We consider a transit currently "triggered" when we've found a period
of exactness in the 24 hours around the queried moment.

Also, minute fixes to the table.
* The good: using sections and articles vs. those benighted dividers.
* The bad: the asIcon' story is rather disappointing. Maybe
  Firmament _should_ provide Icons for Asc and MC?
@lfborjas lfborjas merged commit 892887f into master Dec 23, 2020
@lfborjas lfborjas deleted the transits-continued branch December 24, 2020 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transits
1 participant