astroscript 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,106 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "swe4r"
4
+
5
+ module Swe4r
6
+ SE_SIDBIT_USER_UT = 1024
7
+ end
8
+
9
+ module SwissEphemeris
10
+ AST_OFFSET = 10_000
11
+
12
+ BODIES = {
13
+ SO: { id: Swe4r::SE_SUN, name: "sun", symbol: "☉" },
14
+ SU: { id: Swe4r::SE_SUN, name: "sun", symbol: "☉" },
15
+ MO: { id: Swe4r::SE_MOON, name: "moon", symbol: "☽" },
16
+ ME: { id: Swe4r::SE_MERCURY, name: "mercury", symbol: "☿" },
17
+ VE: { id: Swe4r::SE_VENUS, name: "venus", symbol: "♀" },
18
+ MA: { id: Swe4r::SE_MARS, name: "mars", symbol: "♂" },
19
+ JU: { id: Swe4r::SE_JUPITER, name: "jupiter", symbol: "♃" },
20
+ SA: { id: Swe4r::SE_SATURN, name: "saturn", symbol: "♄" },
21
+ UR: { id: Swe4r::SE_URANUS, name: "uranus", symbol: "♅" },
22
+ NE: { id: Swe4r::SE_NEPTUNE, name: "neptune", symbol: "♆" },
23
+ PL: { id: Swe4r::SE_PLUTO, name: "pluto", symbol: "♇" }, # '⛢'
24
+ # MN: { id:Swe4r::SE_MEAN_NODE, name: 'n.node', symbol: '☊'},
25
+ # TN: { id:Swe4r::SE_TRUE_NODE, name: 't.node', symbol: '☊'},
26
+ # LI: Swe4r::SE_MEAN_APOG,
27
+ # TL: Swe4r::SE_OSCU_APOG,
28
+ EA: { id: Swe4r::SE_SUN, name: "earth", symbol: "🜨︎", antipode: true },
29
+ CH: { id: Swe4r::SE_CHIRON, name: "chiron", symbol: "\u26b7" }, # ⚷
30
+ CE: { id: Swe4r::SE_CERES, name: "ceres", symbol: "\u02a1" }, # ⚳
31
+ PA: { id: Swe4r::SE_PALLAS, name: "pallas", symbol: "⚴" }, # ⚴
32
+ JN: { id: Swe4r::SE_JUNO, name: "juno", symbol: "⚵" }, # ⚵
33
+ VA: { id: Swe4r::SE_VESTA, name: "vesta", symbol: "⚶" }, # ⚶
34
+ PH: { id: Swe4r::SE_PHOLUS, name: "pholus", symbol: "\u2BDB" }, # ⭛
35
+ SD: { id: AST_OFFSET + 90_377, name: "sedna", symbol: "\u2BF2" },
36
+ ER: { id: AST_OFFSET + 136_199, name: "eris", symbol: "\u2BF1" },
37
+ # Uranian Trans-Neptunian Points
38
+ CU: { id: Swe4r::SE_CUPIDO, name: "cupido", symbol: "\u2BE0" },
39
+ HA: { id: Swe4r::SE_HADES, name: "hades", symbol: "\u2BE1" },
40
+ ZE: { id: Swe4r::SE_ZEUS, name: "zeus", symbol: "\u2BE2" },
41
+ KR: { id: Swe4r::SE_KRONOS, name: "kronos", symbol: "\u2BE3" },
42
+ AN: { id: Swe4r::SE_APOLLON, name: "apollon", symbol: "\u2BE4" }, # :AP
43
+ AD: { id: Swe4r::SE_ADMETOS, name: "admetos", symbol: "\u2BE5" },
44
+ VU: { id: Swe4r::SE_VULKANUS, name: "vulkanus", symbol: "\u2BE6" },
45
+ PO: { id: Swe4r::SE_POSEIDON, name: "poseidon", symbol: "\u2BE7" },
46
+ # asteroid 10: Hygiea
47
+ NN: { name: "n.node", symbol: "☊" },
48
+ SN: { name: "s.node", symbol: "☋", antipode: :NN },
49
+ AC: { name: "ascendant", symbol: "AC", method: true },
50
+ DC: { name: "descendant", symbol: "DC", antipode: :AC },
51
+ MC: { name: "midheaven", symbol: "🅪", method: true },
52
+ IC: { name: "nadir", symbol: "IC", antipode: :MC },
53
+ VX: { name: "vertex", symbol: "Ӿ" }, # 🜊∀
54
+ AV: { name: "antivertex", symbol: "∀", antipode: :VX },
55
+ SVP: { name: "svp", symbol: "♈ᵀ" },
56
+ AP: { name: "aries_point", symbol: "♈", method: true },
57
+ POF: { name: "lot_of_fortune", symbol: "⊗", method: true },
58
+ POS: { name: "lot_of_spirit", symbol: "⦶", method: true },
59
+ POH: { name: "lot_of_harmony", symbol: "❂", method: true },
60
+ POX: { name: "lot_of_sex", symbol: "⚦", method: true }
61
+ }.freeze
62
+
63
+ SYMBOLS = { exalted: "△", detriment: "▽", retrograde: "℞",
64
+ conjunct: "☌", opposite: "☍", trine: "△", sextile: "*", square: "□", octile: "∠",
65
+ semisextile: "⚺", quincunx: "⚻", seqsquiquadrate: "⚼", quintile: "⬠", biquintile: "b⬠",
66
+ trioctile: "⚼" }.freeze # ∿⏦♁⊕⚸
67
+ # stars: ★ ☆ ✢ ✥ ✦ ✧ ❂ ❉ ✯ ❈ 🝊
68
+
69
+ def self.path=(path)
70
+ Swe4r.swe_set_ephe_path(path.to_s)
71
+ end
72
+
73
+ def self.jpl_file=(path)
74
+ swe_set_jpl_file(path.to_s)
75
+ end
76
+
77
+ SIGNS = %i[aries taurus gemini cancer leo virgo libra scorpio sagittarius capricorn aquarius pisces].freeze
78
+ HOUSES = %w[I II III IV V VI VII VIII IX X XI XII].unshift(nil)
79
+ ZODIAC_SYM = ("\u2648".."\u2653").to_a # %w[♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓ ]
80
+
81
+ RULERSHIPS = {
82
+ SO: [:leo],
83
+ MO: [:cancer],
84
+ ME: %i[gemini virgo],
85
+ VE: %i[taurus libra],
86
+ MA: %i[aries scorpio],
87
+ JU: %i[sagittarius pisces],
88
+ SA: %i[capricorn aquarius],
89
+ UR: [:aquarius],
90
+ NE: [:pisces],
91
+ PL: [:scorpio],
92
+ NN: [:aquarius], # Jaimini only
93
+ SN: [:scorpio] # Jaimini only
94
+ }.freeze
95
+
96
+ EXALTATION = { # https://en.wikipedia.org/wiki/Exaltation_(astrology)
97
+ SO: [:aries, 19],
98
+ MO: [:taurus, 3],
99
+ ME: [:virgo, 15],
100
+ VE: [:pisces, 27],
101
+ MA: [:capricorn, 28],
102
+ JU: [:cancer, 15],
103
+ SA: [:libra, 21],
104
+ NN: [:gemini, 3]
105
+ }.freeze
106
+ end
@@ -0,0 +1,4 @@
1
+ module Astroscript
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
@@ -0,0 +1,33 @@
1
+ The complete list of house methods in alphabetical order is:
2
+ hsys = ‘B’ Alcabitus
3
+ ‘Y’ APC houses
4
+ ‘X’ Axial rotation system / Meridian system / Zariel
5
+ ‘H’ Azimuthal or horizontal system
6
+ ‘C’ Campanus
7
+ ‘F’ Carter "Poli-Equatorial"
8
+ ‘A’ or ‘E’ Equal (cusp 1 is Ascendant)
9
+ ‘D’ Equal MC (cusp 10 is MC)
10
+ ‘N’ Equal/1=Aries
11
+ ‘G’ Gauquelin sector
12
+ Goelzer -> Krusinski
13
+ Horizontal system -> Azimuthal system
14
+ ‘I’ Sunshine (Makransky, solution Treindl)
15
+ ‘i’ Sunshine (Makransky, solution Makransky)
16
+ ‘K’ Koch
17
+ ‘U’ Krusinski-Pisa-Goelzer
18
+ Meridian system -> axial rotation
19
+ ‘M’ Morinus
20
+ Neo-Porphyry -> Pullen SD
21
+ Pisa -> Krusinski
22
+ ‘P’ Placidus
23
+ Poli-Equatorial -> Carter
24
+ ‘T’ Polich/Page (“topocentric” system)
25
+ ‘O’ Porphyrius
26
+ ‘L’ Pullen SD (sinusoidal delta) – ex Neo-Porphyry
27
+ ‘Q’ Pullen SR (sinusoidal ratio)
28
+ ‘R’ Regiomontanus
29
+ ‘S’ Sripati
30
+ “Topocentric” system -> Polich/Page
31
+ ‘V’ Vehlow equal (Asc. in middle of house 1)
32
+ ‘W’ Whole sign
33
+ Zariel -> Axial rotation system
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
metadata ADDED
@@ -0,0 +1,318 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: astroscript
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ platform: ruby
6
+ authors:
7
+ - David Lowenfels
8
+ - Harlan T Wood
9
+ autorequire:
10
+ bindir: exe
11
+ cert_chain: []
12
+ date: 2024-11-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: activesupport
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '8.0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '8.0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: geocoder
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.8'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.8'
42
+ - !ruby/object:Gem::Dependency
43
+ name: httparty
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '0.21'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '0.21'
56
+ - !ruby/object:Gem::Dependency
57
+ name: swe4r
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: 1.1.2
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: 1.1.2
70
+ - !ruby/object:Gem::Dependency
71
+ name: amazing_print
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: byebug
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: dotenv
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: json_expressions
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: minitest
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: '5.16'
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: '5.16'
140
+ - !ruby/object:Gem::Dependency
141
+ name: minitest-reporters
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - "~>"
145
+ - !ruby/object:Gem::Version
146
+ version: '1.6'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '1.6'
154
+ - !ruby/object:Gem::Dependency
155
+ name: minitest-rg
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
168
+ - !ruby/object:Gem::Dependency
169
+ name: pretty-diffs
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ type: :development
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ - !ruby/object:Gem::Dependency
183
+ name: rake
184
+ requirement: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - "~>"
187
+ - !ruby/object:Gem::Version
188
+ version: '13.0'
189
+ type: :development
190
+ prerelease: false
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - "~>"
194
+ - !ruby/object:Gem::Version
195
+ version: '13.0'
196
+ - !ruby/object:Gem::Dependency
197
+ name: rubocop
198
+ requirement: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: '0'
203
+ type: :development
204
+ prerelease: false
205
+ version_requirements: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
210
+ - !ruby/object:Gem::Dependency
211
+ name: shoulda-context
212
+ requirement: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - "~>"
215
+ - !ruby/object:Gem::Version
216
+ version: 3.0.0.rc1
217
+ type: :development
218
+ prerelease: false
219
+ version_requirements: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - "~>"
222
+ - !ruby/object:Gem::Version
223
+ version: 3.0.0.rc1
224
+ - !ruby/object:Gem::Dependency
225
+ name: vcr
226
+ requirement: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
231
+ type: :development
232
+ prerelease: false
233
+ version_requirements: !ruby/object:Gem::Requirement
234
+ requirements:
235
+ - - ">="
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
238
+ - !ruby/object:Gem::Dependency
239
+ name: webmock
240
+ requirement: !ruby/object:Gem::Requirement
241
+ requirements:
242
+ - - ">="
243
+ - !ruby/object:Gem::Version
244
+ version: '0'
245
+ type: :development
246
+ prerelease: false
247
+ version_requirements: !ruby/object:Gem::Requirement
248
+ requirements:
249
+ - - ">="
250
+ - !ruby/object:Gem::Version
251
+ version: '0'
252
+ description: Uses swe4r bindings for Swiss Ephemeris, note license for Ephemeris data
253
+ email:
254
+ - 282+dfl@users.noreply.github.com
255
+ executables:
256
+ - astroscript
257
+ extensions: []
258
+ extra_rdoc_files: []
259
+ files:
260
+ - ".rubocop.defaults.yml"
261
+ - ".rubocop.yml"
262
+ - ".ruby-version"
263
+ - ARCH.md
264
+ - CHANGELOG.md
265
+ - LICENSE.txt
266
+ - Rakefile
267
+ - exe/astroscript
268
+ - lib/astro_helper.rb
269
+ - lib/astroscript.rb
270
+ - lib/astroscript/aspect.rb
271
+ - lib/astroscript/body.rb
272
+ - lib/astroscript/body/const_body.rb
273
+ - lib/astroscript/body/house_cusp.rb
274
+ - lib/astroscript/body/method_body.rb
275
+ - lib/astroscript/body/midpoint.rb
276
+ - lib/astroscript/calculator.rb
277
+ - lib/astroscript/chart.rb
278
+ - lib/astroscript/version.rb
279
+ - lib/ruby_extensions.rb
280
+ - lib/swiss_ephemeris.rb
281
+ - sig/astroscript.rbs
282
+ - vendor/swe_data/houses.txt
283
+ - vendor/swe_data/s136199s.se1
284
+ - vendor/swe_data/se00010s.se1
285
+ - vendor/swe_data/se90377s.se1
286
+ - vendor/swe_data/se90482s.se1
287
+ - vendor/swe_data/seas_18.se1
288
+ - vendor/swe_data/semo_18.se1
289
+ - vendor/swe_data/sepl_18.se1
290
+ homepage: http://github.com/dfl/astroscript
291
+ licenses:
292
+ - MIT
293
+ metadata:
294
+ allowed_push_host: https://rubygems.org
295
+ homepage_uri: http://github.com/dfl/astroscript
296
+ source_code_uri: http://github.com/dfl/astroscript
297
+ changelog_uri: https://github.com/dfl/astroscript_lite/blob/main/CHANGELOG.md
298
+ rubygems_mfa_required: 'true'
299
+ post_install_message:
300
+ rdoc_options: []
301
+ require_paths:
302
+ - lib
303
+ required_ruby_version: !ruby/object:Gem::Requirement
304
+ requirements:
305
+ - - ">="
306
+ - !ruby/object:Gem::Version
307
+ version: 3.0.0
308
+ required_rubygems_version: !ruby/object:Gem::Requirement
309
+ requirements:
310
+ - - ">="
311
+ - !ruby/object:Gem::Version
312
+ version: '0'
313
+ requirements: []
314
+ rubygems_version: 3.5.15
315
+ signing_key:
316
+ specification_version: 4
317
+ summary: Astrology essentials in idiomatic ruby
318
+ test_files: []