astropanel 2.7 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -4
  3. data/bin/astropanel +92 -17
  4. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab87ddd7784d3b47b1a807f39f4a1116ef5498da9e1abed7aa83c77daae7e5a4
4
- data.tar.gz: d2c5f209b93b9cd369ee056aa9d41e8b118f0c6137e99797cf58656c15bb8aab
3
+ metadata.gz: 721a794f0a0c6c84cafa4dff6c93ad6741a247ece7710809735b631a3c9a782c
4
+ data.tar.gz: 1ddffb11f1a0f61b2764295e846dfd80ca74497b5025ab4fdc716d632496f067
5
5
  SHA512:
6
- metadata.gz: 18c52254d3c68c8f03797639d5d9cc8546a5824a8db17200fdd8345a3c53256232eec6058ff7d1fec4f55a2305dfac89c0db37f4f82eedf9698b8e978fb286b0
7
- data.tar.gz: 9c7cb190ce0502763f5ef4ff16dd08ea11f6621f77b39555deb698f7d172b2ac6c4c647b937676a2208b8c630ed64b47f19c8ee5ceaab52b0dcc9cf900e569f0
6
+ metadata.gz: 0ae5ab39b7eea65c3338d73e4041926a9850eb9c7b8c18241a75f530b83d7e61592a188cf0f7af029744dd53f929f23fb684a7b5c62398eef8cdc40d2055fbbf
7
+ data.tar.gz: '08227fd9689b5d494518a8f465c0835c63bb082e3cd615f0f7f6c5272eb2fb117de618457ac31a48055274e6f51c0f0396fd350f5c12a45d1008781f10b103cb'
data/README.md CHANGED
@@ -5,11 +5,25 @@ amateur astronomers with weather forecast, ephemeris, astronomical events and
5
5
  more. It's what you need to decide wether to take your telescope out for a
6
6
  spin.
7
7
 
8
+ **NEW in 3.0.0: Major accuracy improvement with IAU 2006 obliquity standard and higher-precision ephemeris calculations from the [ephemeris](https://github.com/isene/ephemeris) project**
9
+
8
10
  **NOTE: 2.0: Full rewrite using [rcurses](https://github.com/isene/rcurses)**
9
11
 
10
- Install by cloning this repo and putting `astropanel.rb` into your "bin"
12
+ Install by cloning this repo and putting `astropanel` into your "bin"
11
13
  directory. Or you can simply run `gem install astropanel`.
12
14
 
15
+ ## Accuracy Improvements in 3.0.0
16
+ This version includes significant accuracy improvements to the ephemeris calculations:
17
+
18
+ * **IAU 2006 Obliquity Standard**: Updated from the simplified obliquity calculation to the modern International Astronomical Union 2006 standard with proper secular variations
19
+ * **Higher-Precision Orbital Elements**: More accurate mean motion values for all planets based on modern ephemeris data
20
+ * **Enhanced Perturbation Calculations**: Detailed lunar, Jupiter, Saturn, and Uranus perturbation calculations for improved positional accuracy
21
+ * **Better Topocentric Corrections**: Improved geocentric-to-topocentric coordinate transformations
22
+
23
+ These improvements provide significantly more accurate planetary positions, with improvements of 10+ arcminutes for major planets and up to 1 degree for the Moon compared to previous versions.
24
+
25
+ The enhanced ephemeris calculations are based on the [ephemeris](https://github.com/isene/ephemeris) project, which implements modern astronomical standards for higher accuracy.
26
+
13
27
  ## Functionality
14
28
  This program gives you essential data to plan your observations:
15
29
 
@@ -25,7 +39,7 @@ This program gives you essential data to plan your observations:
25
39
  view
26
40
  * Star chart showing in the terminal for the selected day and time of day
27
41
  PS: The star chart is only generated for latitudes above +23
28
- * A table showing RA, Dec, distance, rise, set and transit for the planets
42
+ * A table showing RA, Dec, distance, rise, set and transit for the planets with significantly improved accuracy using modern astronomical standards
29
43
  * Show today's Astronomy Picture Of the Day
30
44
 
31
45
  ## Condition rules
@@ -61,8 +75,8 @@ Also, images like the star chart and APOD is only reliably tested on the URXVT
61
75
  terminal emulator.
62
76
 
63
77
  ## Launching Astropanel
64
- The first time you launch Astropanel (make astropanel.rb executable; `chmod +x
65
- astropanel.rb` and run it), it will ask for your location, Latitude and
78
+ The first time you launch Astropanel (make astropanel executable; `chmod +x
79
+ astropanel` and run it), it will ask for your location, Latitude and
66
80
  Longitude.
67
81
 
68
82
  When you start the program, it will show you the list of forecast points for
data/bin/astropanel CHANGED
@@ -14,7 +14,8 @@
14
14
  # for any damages resulting from its use. Further, I am under no
15
15
  # obligation to maintain or extend this software. It is provided
16
16
  # on an 'as is' basis without any expressed or implied warranty.
17
- # Version: 2.7: Image redraw fix for i3-wm workspace switching
17
+ # Version: 4.0.0: Breaking change - requires rcurses 6.0.0+ with explicit initialization
18
+ # for Ruby 3.4+ compatibility
18
19
 
19
20
  # LOAD MODULES {{{1
20
21
  require 'io/console'
@@ -67,13 +68,14 @@ class Ephemeris
67
68
  @lat, @lon, @tz = lat, lon, tz
68
69
  y, mo, d = date.split('-').map(&:to_i)
69
70
  @d = 367*y - 7*(y + (mo+9)/12)/4 + 275*mo/9 + d - 730530
70
- @ecl = 23.4393 - 3.563E-7 * @d
71
+ @ecl = 23.439279444 - 46.8150/3600*(@d/36525) - 0.00059/3600*(@d/36525)**2 + 0.001813/3600*(@d/36525)**3
71
72
  body_data
72
73
 
73
74
  # ----- Sun computing -----
74
75
  b = @body["sun"]
75
76
  w_s = (b["w"] % 360)
76
77
  m_s = (b["M"] % 360)
78
+ @ms = m_s
77
79
  es = solve_kepler(m_s, b["e"])
78
80
  x = Math.cos(es.deg) - b["e"]
79
81
  y = Math.sin(es.deg) * Math.sqrt(1 - b["e"]**2)
@@ -106,15 +108,15 @@ class Ephemeris
106
108
 
107
109
  def body_data # {{{2
108
110
  @body = {
109
- "sun" => {"N"=>0.0, "i"=>0.0, "w"=>282.9404+4.70935e-5*@d, "a"=>1.0, "e"=>0.016709-1.151e-9*@d, "M"=>356.0470+0.98555*@d},
110
- "moon" => {"N"=>125.1228-0.0529538083*@d, "i"=>5.1454, "w"=>318.0634+0.1643573223*@d, "a"=>60.2666, "e"=>0.0549, "M"=>115.3654+13.064886*@d},
111
+ "sun" => {"N"=>0.0, "i"=>0.0, "w"=>282.9404+4.70935e-5*@d, "a"=>1.000000, "e"=>0.016709-1.151e-9*@d, "M"=>356.0470+0.9856002585*@d},
112
+ "moon" => {"N"=>125.1228-0.0529538083*@d, "i"=>5.1454, "w"=>318.0634+0.1643573223*@d, "a"=>60.2666, "e"=>0.054900, "M"=>115.3654+13.0649929509*@d},
111
113
  "mercury" => {"N"=>48.3313+3.24587e-5*@d, "i"=>7.0047+5e-8*@d, "w"=>29.1241+1.01444e-5*@d, "a"=>0.387098, "e"=>0.205635+5.59e-10*@d, "M"=>168.6562+4.0923344368*@d},
112
114
  "venus" => {"N"=>76.6799+2.46590e-5*@d, "i"=>3.3946+2.75e-8*@d, "w"=>54.8910+1.38374e-5*@d, "a"=>0.72333, "e"=>0.006773-1.302e-9*@d, "M"=>48.0052+1.6021302244*@d},
113
- "mars" => {"N"=>49.5574+2.11081e-5*@d, "i"=>1.8497-1.78e-8*@d, "w"=>286.5016+2.92961e-5*@d, "a"=>1.523688, "e"=>0.093405+2.516e-9*@d, "M"=>18.6021+0.52398*@d},
114
- "jupiter" => {"N"=>100.4542+2.76854e-5*@d, "i"=>1.3030-1.557e-7*@d, "w"=>273.8777+1.64505e-5*@d,"a"=>5.20256, "e"=>0.048498+4.469e-9*@d, "M"=>19.8950+0.083052*@d},
115
- "saturn" => {"N"=>113.6634+2.38980e-5*@d, "i"=>2.4886-1.081e-7*@d, "w"=>339.3939+2.97661e-5*@d,"a"=>9.55475, "e"=>0.055546-9.499e-9*@d, "M"=>316.9670+0.03339*@d},
116
- "uranus" => {"N"=>74.0005+1.3978e-5*@d, "i"=>0.7733+1.9e-8*@d, "w"=>96.6612+3.0565e-5*@d, "a"=>19.18171-1.55e-8*@d, "e"=>0.047318+7.45e-9*@d, "M"=>142.5905+0.01168*@d},
117
- "neptune" => {"N"=>131.7806+3.0173e-5*@d, "i"=>1.7700-2.55e-7*@d, "w"=>272.8461-6.027e-6*@d, "a"=>30.05826+3.313e-8*@d, "e"=>0.008606+2.15e-9*@d, "M"=>260.2471+0.005953*@d}
115
+ "mars" => {"N"=>49.5574+2.11081e-5*@d, "i"=>1.8497-1.78e-8*@d, "w"=>286.5016+2.92961e-5*@d, "a"=>1.523688, "e"=>0.093405+2.516e-9*@d, "M"=>18.6021+0.5240207766*@d},
116
+ "jupiter" => {"N"=>100.4542+2.76854e-5*@d, "i"=>1.3030-1.557e-7*@d, "w"=>273.8777+1.64505e-5*@d, "a"=>5.20256, "e"=>0.048498+4.469e-9*@d, "M"=>19.8950+0.0830853001*@d},
117
+ "saturn" => {"N"=>113.6634+2.38980e-5*@d, "i"=>2.4886-1.081e-7*@d, "w"=>339.3939+2.97661e-5*@d, "a"=>9.55475, "e"=>0.055546-9.499e-9*@d, "M"=>316.9670+0.0334442282*@d},
118
+ "uranus" => {"N"=>74.0005+1.3978e-5*@d, "i"=>0.7733+1.9e-8*@d, "w"=>96.6612+3.0565e-5*@d, "a"=>19.18171-1.55e-8*@d, "e"=>0.047318+7.45e-9*@d, "M"=>142.5905+0.011725806*@d},
119
+ "neptune" => {"N"=>131.7806+3.0173e-5*@d, "i"=>1.7700-2.55e-7*@d, "w"=>272.8461-6.027e-6*@d, "a"=>30.05826+3.313e-8*@d, "e"=>0.008606+2.15e-9*@d, "M"=>260.2471+0.005995147*@d}
118
120
  }
119
121
  end
120
122
 
@@ -216,7 +218,69 @@ class Ephemeris
216
218
  lat = Math.atan2(zeclip, Math.sqrt(xeclip*xeclip + yeclip*yeclip))*180/pi
217
219
  r_b = Math.sqrt(xeclip*xeclip + yeclip*yeclip + zeclip*zeclip)
218
220
 
219
- # perturbations for Moon, Jupiter, Saturn, Uranus as in your original…
221
+ # perturbations calculations
222
+ m_J = @body["jupiter"]["M"]
223
+ m_S = @body["saturn"]["M"]
224
+ m_U = @body["uranus"]["M"]
225
+ plon = 0
226
+ plat = 0
227
+ pdist = 0
228
+ case body
229
+ when "moon"
230
+ lb = (n_b + w_b + m_b) % 360
231
+ db = (lb - @ls + 360) % 360
232
+ fb = (lb - n_b + 360) % 360
233
+ plon += -1.274 * Math.sin((m_b - 2*db).deg)
234
+ plon += 0.658 * Math.sin((2*db).deg)
235
+ plon += -0.186 * Math.sin(@ms.deg)
236
+ plon += -0.059 * Math.sin((2*m_b - 2*db).deg)
237
+ plon += -0.057 * Math.sin((m_b - 2*db + @ms).deg)
238
+ plon += 0.053 * Math.sin((m_b + 2*db).deg)
239
+ plon += 0.046 * Math.sin((2*db - @ms).deg)
240
+ plon += 0.041 * Math.sin((m_b - @ms).deg)
241
+ plon += -0.035 * Math.sin(db.deg)
242
+ plon += -0.031 * Math.sin((m_b + @ms).deg)
243
+ plon += -0.015 * Math.sin((2*fb - 2*db).deg)
244
+ plon += 0.011 * Math.sin((m_b - 4*db).deg)
245
+ plat += -0.173 * Math.sin((fb - 2*db).deg)
246
+ plat += -0.055 * Math.sin((m_b - fb - 2*db).deg)
247
+ plat += -0.046 * Math.sin((m_b + fb - 2*db).deg)
248
+ plat += 0.033 * Math.sin((fb + 2*db).deg)
249
+ plat += 0.017 * Math.sin((2*m_b + fb).deg)
250
+ pdist += -0.58 * Math.cos((m_b - 2*db).deg)
251
+ pdist += -0.46 * Math.cos(2*db.deg)
252
+ when "jupiter"
253
+ plon += -0.332 * Math.sin((2*m_J - 5*m_S - 67.6).deg)
254
+ plon += -0.056 * Math.sin((2*m_J - 2*m_S + 21).deg)
255
+ plon += 0.042 * Math.sin((3*m_J - 5*m_S + 21).deg)
256
+ plon += -0.036 * Math.sin((m_J - 2*m_S).deg)
257
+ plon += 0.022 * Math.cos((m_J - m_S).deg)
258
+ plon += 0.023 * Math.sin((2*m_J - 3*m_S + 52).deg)
259
+ plon += -0.016 * Math.sin((m_J - 5*m_S - 69).deg)
260
+ when "saturn"
261
+ plon += 0.812 * Math.sin((2*m_J - 5*m_S - 67.6).deg)
262
+ plon += -0.229 * Math.cos((2*m_J - 4*m_S - 2).deg)
263
+ plon += 0.119 * Math.sin((m_J - 2*m_S - 3).deg)
264
+ plon += 0.046 * Math.sin((2*m_J - 6*m_S - 69).deg)
265
+ plon += 0.014 * Math.sin((m_J - 3*m_S + 32).deg)
266
+ plat += -0.020 * Math.cos((2*m_J - 4*m_S - 2).deg)
267
+ plat += 0.018 * Math.sin((2*m_J - 6*m_S - 49).deg)
268
+ when "uranus"
269
+ plon += 0.040 * Math.sin((m_S - 2*m_U + 6).deg)
270
+ plon += 0.035 * Math.sin((m_S - 3*m_U + 33).deg)
271
+ plon += -0.015 * Math.sin((m_J - m_U + 20).deg)
272
+ end
273
+ lon += plon
274
+ lat += plat
275
+ r_b += pdist
276
+ if body == "moon"
277
+ xeclip = Math.cos(lon.deg) * Math.cos(lat.deg)
278
+ yeclip = Math.sin(lon.deg) * Math.cos(lat.deg)
279
+ zeclip = Math.sin(lat.deg)
280
+ else
281
+ xeclip += @xs
282
+ yeclip += @ys
283
+ end
220
284
 
221
285
  # transform to equatorial coords
222
286
  xequat = xeclip
@@ -225,16 +289,24 @@ class Ephemeris
225
289
  ra = (Math.atan2(yequat, xequat)*180/pi + 360) % 360
226
290
  dec = Math.atan2(zequat, Math.sqrt(xequat*xequat + yequat*yequat))*180/pi
227
291
 
228
- # apply parallax if Moon…
229
- par = body == "moon" ? Math.asin(1/r_b)*180/pi : (8.794/3600)/r_b
230
- # topocentric corrections…
231
- # all the rest of your code …
292
+ # apply topocentric corrections
293
+ body == "moon" ? par = Math.asin(1/r_b)*180/pi : par = (8.794/3600)/r_b
294
+ gclat = @lat - 0.1924 * Math.sin(2*@lat.deg)
295
+ rho = 0.99833 + 0.00167 * Math.cos(2*@lat.deg)
296
+ lst = @sidtime * 15
297
+ ha = (lst - ra + 360) % 360
298
+ g = Math.atan(Math.tan(gclat.deg) / Math.cos(ha.deg))*180/pi
299
+ topRA = ra - par * rho * Math.cos(gclat.deg) * Math.sin(ha.deg) / Math.cos(dec.deg)
300
+ topDecl = dec - par * rho * Math.sin(gclat.deg) * Math.sin((g - dec).deg) / Math.sin(g.deg)
301
+ ra = topRA.round(4)
302
+ dec = topDecl.round(4)
303
+ r = Math.sqrt(xequat*xequat + yequat*yequat + zequat*zequat).round(4)
232
304
 
233
305
  # finally compute rise/transit/set:
234
306
  ri, tr, se = rts(ra, dec, (body=="sun" ? -0.833 : (body=="moon" ? -0.833 : 0)))
235
307
 
236
- # return array of [ra, dec, r_b, hms_dms..., ri, tr, se]
237
- [ra.round(4), dec.round(4), r_b.round(4), *hms_dms(ra,dec), ri, tr, se]
308
+ # return array of [ra, dec, r, hms_dms..., ri, tr, se]
309
+ [ra, dec, r, *hms_dms(ra,dec), ri, tr, se]
238
310
  end
239
311
 
240
312
  def compute_moon_phase # {{{2
@@ -1177,12 +1249,15 @@ begin
1177
1249
  # a single quick DNS + TCP check
1178
1250
  TCPSocket.new('api.met.no', 443).close
1179
1251
  rescue SocketError, Socket::ResolutionError => e
1180
- $stderr.puts "FATAL: cant resolve api.met.no – network appears down (#{e.message})"
1252
+ $stderr.puts "FATAL: can't resolve api.met.no – network appears down (#{e.message})"
1181
1253
  $stdin.cooked!
1182
1254
  $stdin.echo = true
1183
1255
  exit!
1184
1256
  end
1185
1257
 
1258
+ # Initialize rcurses (required for rcurses 6.0.0+)
1259
+ Rcurses.init!
1260
+
1186
1261
  AstroPanelApp.new
1187
1262
 
1188
1263
  # VIM MODELINE{{{1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: astropanel
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.7'
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-05 00:00:00.000000000 Z
11
+ date: 2025-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rcurses
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.5'
19
+ version: '6.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '3.5'
26
+ version: '6.0'
27
27
  description: 'This program shows essential data in order to plan your observations:
28
28
  9 days weather forecast, full ephemeris for the Sun, the Moon and all major planets,
29
29
  complete with graphic representation of rise/set times, detailed info for each day
30
30
  with important astronomical events, star chart displayed in the terminal and more.
31
- New in 2.0: Full rewrite using rcurses (https://github.com/isene/rcurses). 2.7:
32
- Image redraw fix for i3-wm workspace switching.'
31
+ Version 4.0.0: Breaking change - requires rcurses 6.0.0+ with explicit initialization
32
+ for Ruby 3.4+ compatibility.'
33
33
  email: g@isene.com
34
34
  executables:
35
35
  - astropanel