From eb70f55938de1bfb735f281a3d301917a0824bcb Mon Sep 17 00:00:00 2001 From: flux Date: Sun, 23 Dec 2018 22:02:32 +0100 Subject: [PATCH] - added rising decans - changed info modal - added ascendant and mc to ephemeris calculation --- js/SL.Calendar.js | 17 ++- js/modules/astrology.js | 72 +++++++++++ js/modules/decans.js | 276 +++++++++++++++++++++++++++++++++++++++- lib/sweph/pmom.c | 13 +- 4 files changed, 368 insertions(+), 10 deletions(-) diff --git a/js/SL.Calendar.js b/js/SL.Calendar.js index 3fcd441..01eeeb8 100644 --- a/js/SL.Calendar.js +++ b/js/SL.Calendar.js @@ -28,7 +28,7 @@ SL.Calendar = (function() { function about() { $('
').loadTemplate($("#tpl-modal"), { title : '

SUBLUNAR ALMANAC

', - right : '

Buy me a coffeeBuy me a coffee GitHub

(MIT) © 2018 T. F. Raaion / sublunar space


Astronomical calculations are based on
Swiss Ephemeris API, © 1997-2016 Astrodienst AG, (GPLv2.0+)
and the Table of New Moon Dates by Steve Moshier.

The front-end relies on the following Javascript Libraries:
jQuery 3.2.1, © JS Foundation, (MIT)
Bootstrap 3.3.7, © Twitter, Inc., (MIT)
jQuery.loadTemplate, © 2013 Paul Burgess and other contributors, (MIT)
MomentJS 2.18.1, © Tim Wood, Iskren Chernev, Moment.js contributors, (MIT)
Isotope 3.0.4, © 2017 Metafizzy, (GPLv3)
DefiantJS 1.4.1, © 2013-2017, Hakan Bilgin, (MIT)
NProgress, © 2013, 2014 Rico Sta. Cruz, (MIT)
OsmNamesAutocomplete, © 2016 Klokan Technologies GmbH, (GPLv3)
tzlookup, by The Dark Sky, LLC, (CC0 1.0 Universal)
ics.js, © 2018 Travis Krause, (MIT)

The design is based on
bootswatch v3.3.7, © 2012-2017 Thomas Park, (MIT).

' + right : '

Buy Me a Coffee at ko-fi.com

GitHub

(MIT) © 2018 T. F. Raaion / sublunar space
contact: info@sublunar.space


Astronomical calculations are based on
Swiss Ephemeris API, © 1997-2016 Astrodienst AG, (GPLv2.0+)
and the Table of New Moon Dates by Steve Moshier.

The front-end relies on the following Javascript Libraries:
jQuery 3.2.1, © JS Foundation, (MIT)
Bootstrap 3.3.7, © Twitter, Inc., (MIT)
jQuery.loadTemplate, © 2013 Paul Burgess and other contributors, (MIT)
MomentJS 2.18.1, © Tim Wood, Iskren Chernev, Moment.js contributors, (MIT)
Isotope 3.0.4, © 2017 Metafizzy, (GPLv3)
DefiantJS 1.4.1, © 2013-2017, Hakan Bilgin, (MIT)
NProgress, © 2013, 2014 Rico Sta. Cruz, (MIT)
OsmNamesAutocomplete, © 2016 Klokan Technologies GmbH, (GPLv3)
tzlookup, by The Dark Sky, LLC, (CC0 1.0 Universal)
ics.js, © 2018 Travis Krause, (MIT)

The design is based on
bootswatch v3.3.7, © 2012-2017 Thomas Park, (MIT).

' }) .appendTo('#modals') .attr('id', 'aboutSLC') @@ -104,6 +104,12 @@ SL.Calendar = (function() { }); } + function unik(array){ + return array.filter(function(el, index, arr) { + return index === arr.indexOf(el); + }); + } + /** * Hours object with variable and function to generate the grid of planetary hours * @public {Object} moments - JSON object holding all the data returned from the swiss ephemeris calculations done by pmom.c @@ -128,7 +134,7 @@ SL.Calendar = (function() { alert("Sorry, the calculation is limited to 60 days at the moment! Calculating the first 60 out of your desired "+days+" days!"); days = 60; } - $('#grid').empty(); + $('#grid .stoke').html('calculating...please wait'); $('#download').remove(); Filter.load(); var files = document.getElementById('fileInput').files; @@ -228,6 +234,7 @@ SL.Calendar = (function() { $('#calendar').isotope('destroy'); NProgress.done(); clearTimeout(timeout); + $('#grid .stoke').empty(); } } @@ -298,7 +305,7 @@ SL.Calendar = (function() { }); }); var tagcloud = tags.join(" ").split(' ').sort(); - $('#houractions').append( '
Tags
\n'+$.unique( tagcloud ).join(" ")); + $('#houractions').append( '
Tags
\n'+unik( tagcloud ).join(" ")); var title = SL.Astro.Logy.planet.day[mom.planetary.day.no+1]+"+Hour+"+(mom.planetary.hour.no+1); var desc = $('#hourinfos').html()+'\n\n'+$('#houractions').text(); $('').attr('role', 'button').attr('target', '_blank').attr('href', @@ -384,7 +391,7 @@ SL.Calendar = (function() { } }); }); - var uniqtags = $.unique(tags); + var uniqtags = unik(tags); // create DOM objects uniqtags.sort().forEach(function(tag) { tagline += '
  •  '+tag+'
  • \n'; @@ -519,7 +526,7 @@ SL.Calendar = (function() { if (actionArray[i].hasOwnProperty('action') && actionArray[i].action) actions.push(actionArray[i]); } } - if (tags) tagstring = $.unique(tags.join(" ").split(' ')).sort().join(" "); + if (tags) tagstring = unik(tags.join(" ").split(' ')).sort().join(" "); actionstring = actionArray.map(function(el) { return idstring + el.id; }).join(" "); actions.sort(); } diff --git a/js/modules/astrology.js b/js/modules/astrology.js index 4763725..a08d5f1 100644 --- a/js/modules/astrology.js +++ b/js/modules/astrology.js @@ -556,6 +556,78 @@ var module_saturn = { } }; +//Defines Calendar Objects and Methods +var module_ascendant = { + + definitions: { + core: true, + name: "Rising Sign", + group: { + id: "astrology", + text: "Astrology", + info: "true" + }, + actions: [ + [0], + [{ + "id": "1", + "action": "Aries Rising", + "tags": "aries" + }], [{ + "id": "2", + "action": "Taurus Rising", + "tags": "taurus" + }], [{ + "id": "3", + "action": "Gemini Rising", + "tags": "gemini" + }], [{ + "id": "4", + "action": "Cancer Rising", + "tags": "cancer" + }], [{ + "id": "5", + "action": "Leo Rising", + "tags": "leo" + }], [{ + "id": "6", + "action": "Virgo Rising", + "tags": "virgo" + }], [{ + "id": "7", + "action": "Libra Rising", + "tags": "libra" + }], [{ + "id": "8", + "action": "Scorpio Rising", + "tags": "scorpio" + }], [{ + "id": "9", + "action": "Sagittarius Rising", + "tags": "sagittarius" + }], [{ + "id": "10", + "action": "Capricorn Rising", + "tags": "capricorn" + }], [{ + "id": "11", + "action": "Aquarius Rising", + "tags": "aquarius" + }], [{ + "id": "12", + "action": "Pisces Rising", + "tags": "pisces" + }] + ] + }, + property: function(m) { + return SL.Astro.Logy.getZodiac(m.ephemeris.asc.deg).sign; + }, + calculate: function(definitions, property) { + return definitions.actions[property]; + } +}; + //Defines Calendar Objects and Methods var module_aspects = { diff --git a/js/modules/decans.js b/js/modules/decans.js index 98cd786..b62ba6e 100644 --- a/js/modules/decans.js +++ b/js/modules/decans.js @@ -4,7 +4,7 @@ */ //Defines Calendar Objects and Methods -var module_decans_grecoroman = { +var module_decans_solar = { definitions: { name: "Greek + Latin Names", @@ -276,3 +276,277 @@ var module_decans_grecoroman = { return definitions.actions[property]; } }; + +//Defines Calendar Objects and Methods +var module_decans_rising = { + + definitions: { + name: "Rising Decan", + group: { + id: "decans", + text: "Decans", + info: "true" + }, + actions: [ + [0], + [ + { + "id":28, + "action":"Aries 1 rising: Chontare / Senator", + "tags":"chontare senator aries1" + } + ], + [ + { + "id":29, + "action":"Aries 2 rising: Chontachre / Senacher", + "tags":"chontachre senacher aries2" + } + ], + [ + { + "id":30, + "action":"Aries 3 rising: Siket / Sentacher", + "tags":"siket sentacher aries3" + } + ], + [ + { + "id":31, + "action":"Taurus 1 rising: Chôou / Suo", + "tags":"choou suo taurus1" + } + ], + [ + { + "id":32, + "action":"Taurus 2 rising: Erô / Aryo", + "tags":"ero aryo taurus2" + } + ], + [ + { + "id":33, + "action":"Taurus 3 rising: Hrombromare / Romanae", + "tags":"hrombromare romanae taurus3" + } + ], + [ + { + "id":34, + "action":"Gemini 1 rising: Thosolk / Thesogar", + "tags":"thosolk thesogar gemini1" + } + ], + [ + { + "id":35, + "action":"Gemini 2 rising: Ouare / Ver", + "tags":"ouare ver gemini2" + } + ], + [ + { + "id":36, + "action":"Gemini 3 rising: Phouori / Tepis", + "tags":"phouori tepis gemini3" + } + ], + [ + { + "id":1, + "action":"Cancer 1 rising: Sôthis / Sothis", + "tags":"sothis sothis cancer1" + } + ], + [ + { + "id":2, + "action":"Cancer 2 rising: Sit / Sith", + "tags":"sit sith cancer2" + } + ], + [ + { + "id":3, + "action":"Cancer 3 rising: Chnoumis / Thiumis", + "tags":"chnoumis thiumis cancer3" + } + ], + [ + { + "id":4, + "action":"Leo 1 rising: Charchnoumis / Craumonis", + "tags":"charchnoumis craumonis leo1" + } + ], + [ + { + "id":5, + "action":"Leo 2 rising: Êpê / Sic", + "tags":"epe sic leo2" + } + ], + [ + { + "id":6, + "action":"Leo 3 rising: Phoupê / Futile", + "tags":"phoupe futile leo3" + } + ], + [ + { + "id":7, + "action":"Virgo 1 rising: Tôm / Thumis", + "tags":"tom thumis virgo1" + } + ], + [ + { + "id":8, + "action":"Virgo 2 rising: Ouestebkôt / Tophicus", + "tags":"ouestebkot tophicus virgo2" + } + ], + [ + { + "id":9, + "action":"Virgo 3 rising: Aphoso / Afut", + "tags":"aphoso afut virgo3" + } + ], + [ + { + "id":10, + "action":"Libra 1 rising: Souchôe / Seuichut", + "tags":"souchoe seuichut libra1" + } + ], + [ + { + "id":11, + "action":"Libra 2 rising: Ptêchout / Sepisent", + "tags":"ptechout sepisent libra2" + } + ], + [ + { + "id":12, + "action":"Libra 3 rising: Chontare / Senta", + "tags":"chontare senta libra3" + } + ], + [ + { + "id":13, + "action":"Scorpio 1 rising: Stôchnêne / Sentacer", + "tags":"stochnene sentacer scorpio1" + } + ], + [ + { + "id":14, + "action":"Scorpio 2 rising: Sesme / Tepsisen", + "tags":"sesme tepsisen scorpio2" + } + ], + [ + { + "id":15, + "action":"Scorpio 3 rising: Sisieme / Sentineu", + "tags":"sisieme sentineu scorpio3" + } + ], + [ + { + "id":16, + "action":"Sagittarius 1 rising: Hrêouô / Eregbuo", + "tags":"hreouo eregbuo sagittarius1" + } + ], + [ + { + "id":17, + "action":"Sagittarius 2 rising: Sesme / Sagon", + "tags":"sesme sagon sagittarius2" + } + ], + [ + { + "id":18, + "action":"Sagittarius 3 rising: Komme / Chenene", + "tags":"komme chenene sagittarius3" + } + ], + [ + { + "id":19, + "action":"Capricorn 1 rising: Smat / Themeso", + "tags":"smat themeso capricorn1" + } + ], + [ + { + "id":20, + "action":"Capricorn 2 rising: Srô / Epiemu", + "tags":"sro epiemu capricorn2" + } + ], + [ + { + "id":21, + "action":"Capricorn 3 rising: Isrô / Omot", + "tags":"isro omot capricorn3" + } + ], + [ + { + "id":22, + "action":"Aquarius 1 rising: Ptiau / Oro", + "tags":"ptiau oro aquarius1" + } + ], + [ + { + "id":23, + "action":"Aquarius 2 rising: Aue / Cratero", + "tags":"aue cratero aquarius2" + } + ], + [ + { + "id":24, + "action":"Aquarius 3 rising: Ptêbuou / Tepis", + "tags":"ptebuou tepis aquarius3" + } + ], + [ + { + "id":25, + "action":"Pisces 1 rising: Biou / Acha", + "tags":"biou acha pisces1" + } + ], + [ + { + "id":26, + "action":"Pisces 2 rising: Chontare / Tepibui", + "tags":"chontare tepibui pisces2" + } + ], + [ + { + "id":27, + "action":"Pisces 3 rising: Ptibiou / Uiu", + "tags":"ptibiou uiu pisces3" + } + ] + ] + }, + property: function(m) { + return SL.Astro.Logy.getZodiac(m.ephemeris.asc.deg).decan; + }, + calculate: function(definitions, property) { + return definitions.actions[property]; + } +}; diff --git a/lib/sweph/pmom.c b/lib/sweph/pmom.c index c86753a..10a46bc 100644 --- a/lib/sweph/pmom.c +++ b/lib/sweph/pmom.c @@ -112,7 +112,7 @@ int * planetary_moment(double lat, double lon, unsigned long unixtime, double *l int32 year, month, day, hour, minute, second, iflag, iflgret; int pl, ipl, rsmi, return_code, dl, lhour, nm; double hours, tjd_ts, te, lastnew; - double x2[6], datm[2], geopos[3], moon[20], llp[20], lunarday[31]; + double x2[6], datm[2], geopos[3], moon[20], llp[20], lunarday[31], data[13], datb[10]; char serr[AS_MAXCH], starname[255]; datm[0] = 1013.25; // atmospheric pressure @@ -155,6 +155,11 @@ int * planetary_moment(double lat, double lon, unsigned long unixtime, double *l planets[pl+7] = x2[3]; } + // calculate house cusps, ascendant and mc + swe_houses_ex(tjd_ts, 0, latitude, longitude, 'P', data, datb); + planets[14] = datb[0]; // asc + planets[15] = datb[1]; // mc + // calculate moon phase return_code = swe_pheno(te, SE_MOON, iflag, &moon, serr); if (return_code == ERR) printf("%s\n", serr); @@ -259,7 +264,7 @@ int main(int argc,char* argv[]) // days, timestamp, latitude, longitude int32 year, month, day, hour, minute, second, j, h, m, interval, start, days = 1, hm; double hours; unsigned long solar[9] = {0}; - double lunar[3] = {0.0}, planet[14] = {0.0}; + double lunar[3] = {0.0}, planet[16] = {0.0}; // read and assign commandline arguments if ( argc > 1 ) { @@ -312,8 +317,8 @@ int main(int argc,char* argv[]) // days, timestamp, latitude, longitude planetary_moment(latitude, longitude, hm, lunar, planet); printf( - "{ \"ts\": %d, \"lunar\": { \"day\": %d, \"angle\": %f, \"phase\": %f }, \"planetary\": { \"day\": { \"no\": %d, \"start\": %d, \"end\": %d }, \"night\": { \"start\": %d, \"end\": %d }, \"hour\": { \"no\": %d, \"start\": %d, \"end\": %d, \"length\": { \"day\": %d, \"night\": %d } } }, \"ephemeris\": { \"sun\": { \"deg\": %f, \"speed\": %f }, \"moon\": { \"deg\": %f, \"speed\": %f }, \"mercury\": { \"deg\": %f, \"speed\": %f }, \"venus\": { \"deg\": %f, \"speed\": %f }, \"mars\": { \"deg\": %f, \"speed\": %f }, \"jupiter\": { \"deg\": %f, \"speed\": %f }, \"saturn\": { \"deg\": %f, \"speed\": %f } } }", - hm, (int) lunar[0], lunar[1], lunar[2], solar[7], solar[1], solar[2]-1, solar[2], solar[3]-1, h, hm, hm+interval-1, solar[5], solar[6], planet[0], planet[7], planet[1], planet[8], planet[2], planet[9], planet[3], planet[10], planet[4], planet[11], planet[5], planet[12], planet[6], planet[13] + "{ \"ts\": %d, \"lunar\": { \"day\": %d, \"angle\": %f, \"phase\": %f }, \"planetary\": { \"day\": { \"no\": %d, \"start\": %d, \"end\": %d }, \"night\": { \"start\": %d, \"end\": %d }, \"hour\": { \"no\": %d, \"start\": %d, \"end\": %d, \"length\": { \"day\": %d, \"night\": %d } } }, \"ephemeris\": { \"sun\": { \"deg\": %f, \"speed\": %f }, \"moon\": { \"deg\": %f, \"speed\": %f }, \"mercury\": { \"deg\": %f, \"speed\": %f }, \"venus\": { \"deg\": %f, \"speed\": %f }, \"mars\": { \"deg\": %f, \"speed\": %f }, \"jupiter\": { \"deg\": %f, \"speed\": %f }, \"saturn\": { \"deg\": %f, \"speed\": %f }, \"asc\": { \"deg\": %f }, \"mc\": { \"deg\": %f } } }", + hm, (int) lunar[0], lunar[1], lunar[2], solar[7], solar[1], solar[2]-1, solar[2], solar[3]-1, h, hm, hm+interval-1, solar[5], solar[6], planet[0], planet[7], planet[1], planet[8], planet[2], planet[9], planet[3], planet[10], planet[4], planet[11], planet[5], planet[12], planet[6], planet[13], planet[14], planet[15] ); if(j == days && h == 23) printf("");