telescope-term 0.4 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/telescope +74 -57
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ea6b3e73010cffa6a0324e98ab9ef000ddf7c28f175f35d4596d0918d4c5bb5
4
- data.tar.gz: 0e8673add4c94a37ea777955c332cc78d2a5abf12f417910b827fbebd55f59b3
3
+ metadata.gz: 6bccc053edff15e7f32e22c80a0cff25b3ffbc88155743eae29b4cfc1b0a6591
4
+ data.tar.gz: 6b94e933c3bf9b2f263940b5bded516e155972fea4b7cfe492dc9d59ca5b8899
5
5
  SHA512:
6
- metadata.gz: 07ba9d284c86a7780af29ce2af1b12e6c8fa3e43ffc48b4e3743a72d235da4aefd83e1d2260f6a2a0e41aeb0d337a5224149026809571eb3d655a403e2b80530
7
- data.tar.gz: d82e0a4e639b6052b6d2b7aea24146d93964f6f4e889f3c19c3cfa131e1c8a60c4a1f350362007f637bb7e4ad210cfe2cfccc4994c71d8837a8e8f9ec33519b6
6
+ metadata.gz: bad1524541bd4b94f2c8ea827860239ba74c3bb76fc0b0405828dde8c5c833f612b3cf403f86f8123eb2c4228e34922f00e057b58f9da7a73ef0ce57d542a934
7
+ data.tar.gz: 9c58155c752fc6b0bd24b6791be425d0b5c53b08ca7d0c5e01d9f94392ea3dfe751d48a015ab45740df4179468b0f6623f2ad3fcccd7af575bed79c779b1e0d8
data/bin/telescope CHANGED
@@ -1,38 +1,27 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: utf-8
3
3
  @help = <<HELPTEXT
4
- Welcome to Telescope - a terminal/console program for the amateur astronomer.
5
- The top panel lists your telescopes. To add a telescope, press 't' and in the "command line"
6
- at the bottom enter a name, the apperature (APP) and the focal length (FL) and press ENTER.
7
- The lower panel lists your eyepieces with properties for each telescope. To add an eyepiece, press 'e'.
8
- Enter a name, the focal length (FL) and apparent field of view (AFOV) and press ENTER.
9
- Select the telescope and eyepiece panel by pressing TAB, and use the UP, DOWN, HOME and END cursor keys.
10
- Press ENTER on a selected item to change the values in the command line. Delete an item by pressing 'D'.
11
- Move an item up or down in a panel by pressing the PgUP or PgDown keys.
12
- Tag items for use in an observation using the SPACE key (untag all with 'u'). Press 'o' to create an observation
13
- log file with the tagged equipment. The content of the file is then shown in the lower panel.
14
- Refresh all panels with the 'r' key. Escape the selected panels or the command line by pressing 'Ctrl-G'.
15
- Quit via 'q' (or 'Q' if you don't want to save your edits since last session).
16
- Save a backup session with 'b' and load a previously saved backup session with the 'B' key.
17
- Telescope and eyepiece data is saved in the file '.telescope' in your home directory.
4
+ WELCOME TO TELESCOPE - A TERMINAL/CONSOLE PROGRAM FOR THE AMATEUR ASTRONOMER.
5
+ The top panel lists your telescopes with eyepieces in the lower panel. Add a telescope by pressing 't' and fill in the name, the
6
+ apperature (APP) and the focal length (FL) in the "command line" at the bottom and press ENTER. Add an eyepiece with 'e' and enter
7
+ a name, the focal length (FL) and apparent field of view (AFOV) and press ENTER. Select items by using the TAB/UP/DOWN cursor keys.
8
+ Press ENTER on a selected item to change the values in the command line. Delete an item by pressing 'D'. Move an with PgUP/PgDown keys.
9
+ Tag items with the SPACE key (untag all with 'u'), then press 'o' to create an observation log file (content shown in the lower panel).
10
+ Refresh all panels with the 'r' key. Escape the selected panels or the command line by pressing 'Ctrl-G'. Quit via 'q' (or 'Q' if you
11
+ don't want to save your edits since last session). Save a backup session with 'b' and load a saved backup session with the 'B' key.
12
+ Telescope and eyepiece data is saved in the file '.telescope' in your home directory (backup file is '.telescope.bu').
18
13
 
19
- LIST OF TELESCOPE ABBREVIATIONS: LIST OF EYEPIECE ABBREVIATIONS:
20
- APP = Apperature (in millimeters) FL = Focal Length (in millimeters)
21
- FL = Focal Length (in millimeters) AFOV = Apparent Field Of View
22
- F/? = Focal ratio (FL/APP) xMAGN = Magnification (with that telescope)
23
- <MAG = Maximum magnitude visible FOV = True Field Of View (deg/min/sec)
24
- xEYE = Light gathering compared to the human eye XPUP = Exit pupil (in millimeters)
25
- MINx = Minimum usable magnification (may be lower for refractors)
26
- MAXx = Maximum usable magnification
27
- *FIELD = Recommended magnification for star fields
28
- GX/NEB = Recommended magnification for galaxies and nebulae
29
- PL/GCL = Recommended magnification for planets and globular clusters
30
- PLd/2* = Recommended magnification for planet details and double stars
31
- TGHT2* = Recommended magnification for tight double stars
32
- DL-SEP = Minimum separation, Dawes limit
33
- RC-SEP = Minimum separation, Rayleigh limit
34
- MOON = Minimum feature resolved on the Moon (in meters)
35
- SUN = Minimum feature resolved on the Sun (in kilometers)
14
+ LIST OF TELESCOPE ABBREVIATIONS: LIST OF EYEPIECE ABBREVIATIONS:
15
+ APP, FL, F/? = Apperature and Focal Length (millimeters) and F-ratio FL = Focal Length (in millimeters)
16
+ <MAG = Maximum magnitude visible AFOV = Apparent Field Of View
17
+ xEYE = Light gathering compared to the human eye xMAGN = Magnification (with that telescope)
18
+ MINx, MAXx = Minimum and maximum usable magnification FOV = True Field Of View (deg/min/sec)
19
+ XPUP = Exit pupil (in millimeters)
20
+ Recommended magnifications for objects:
21
+ *FIELD = star fields, GX/NEB = galaxies/nebulae, PL/GCL = planets/globular clusters
22
+ PLd/2* = planet details/double stars, TGHT2* = tight double stars
23
+ DL/RC-SEP = Minimum separation, Dawes limit and Rayleigh limit
24
+ MOON, SUN = Minimum feature resolved on the Moon (meters) & Sun (kilometers)
36
25
  HELPTEXT
37
26
  begin # BASIC SETUP
38
27
  if `tput cols`.to_i < 140
@@ -65,6 +54,12 @@ end
65
54
  class Numeric # NUMERIC CLASS EXTENSION
66
55
  def deg
67
56
  self * Math::PI / 180
57
+ end
58
+ def rad
59
+ self * 180 / Math::PI
60
+ end
61
+ def dec2
62
+ "%.2f" % self
68
63
  end
69
64
  end
70
65
  class Curses::Window # CLASS EXTENSION
@@ -254,15 +249,37 @@ def main_getkey # GET KEY FROM USER
254
249
  end
255
250
  when 'UP' # Examples of moving up and down in a window
256
251
  if @tsmark
257
- @tsmark -= 1 unless @tsmark == 0
252
+ if @tsmark == 0
253
+ @tsmark = false
254
+ else
255
+ @tsmark -= 1
256
+ end
258
257
  elsif @epmark
259
- @epmark -= 1 unless @epmark == 0
258
+ if @epmark == 0
259
+ @epmark = false
260
+ @tsmark = @ts.length - 1
261
+ else
262
+ @epmark -= 1
263
+ end
264
+ else
265
+ @epmark = @ep.length - 1
260
266
  end
261
267
  when 'DOWN'
262
268
  if @tsmark
263
- @tsmark += 1 unless @tsmark == @ts.length - 1
269
+ if @tsmark == @ts.length - 1
270
+ @tsmark = false
271
+ @epmark = 0
272
+ else
273
+ @tsmark += 1
274
+ end
264
275
  elsif @epmark
265
- @epmark += 1 unless @epmark == @ep.length - 1
276
+ if @epmark == @ep.length - 1
277
+ @epmark = false
278
+ else
279
+ @epmark += 1
280
+ end
281
+ else
282
+ @tsmark = 0
266
283
  end
267
284
  when 'PgUP'
268
285
  if @tsmark
@@ -344,7 +361,7 @@ def observe
344
361
  mag = (5 * Math::log(d/10, 10) + 7.5).truncate(1).to_s
345
362
  obs += " Max MAG: " + mag
346
363
  sepd = (115.824/d).truncate(2).to_s
347
- sepr = (3600*Math::asin(671E-6/d)*180/Math::PI).truncate(2).to_s
364
+ sepr = (3600*Math::asin(671E-6/d).rad).truncate(2).to_s
348
365
  obs += " Min SEP: " + sepd + "/" + sepr + "\n"
349
366
  end
350
367
  obs += "No telescope(s) chosen for the observation\n" if @tstag.empty?
@@ -391,7 +408,7 @@ def w_ts_show
391
408
  @w_ts.fg = 15
392
409
  @w_ts.bg = 0
393
410
  @ts.each_with_index do |scope, i|
394
- name = scope[0]
411
+ name = scope[0][0...15]
395
412
  d = scope[1]
396
413
  f = scope[2]
397
414
  out = " " + name.ljust(15)
@@ -400,36 +417,36 @@ def w_ts_show
400
417
  attr = Curses::A_BOLD
401
418
  attr = attr | Curses::A_REVERSE if @tsmark == i
402
419
  attr = attr | Curses::A_UNDERLINE if @tstag.include?(i)
403
- @w_ts.pa(254, 0, attr, out)
420
+ @w_ts.pa(254, 0, attr, out) # Basic info (Name, APP, FL)
404
421
  out = (f.to_f/d.to_f).truncate(1).to_s.rjust(6)
405
- @w_ts.pa(254, 0, 0, out)
422
+ @w_ts.pa(254, 0, 0, out) # F/?
406
423
  out = (5 * Math::log(d/10, 10) + 7.5).truncate(1).to_s.rjust(6)
407
- @w_ts.pa(229, 0, 0, out)
424
+ @w_ts.pa(229, 0, 0, out) # <MAG
408
425
  out = (d**2/49).to_i.to_s.rjust(6)
409
- @w_ts.pa(229, 0, 0, out)
426
+ @w_ts.pa(229, 0, 0, out) # xEYE
410
427
  out = magx(d, f, 1/7.to_f)
411
- @w_ts.pa(194, 0, 0, out)
428
+ @w_ts.pa(194, 0, 0, out) # MINx
412
429
  out = magx(d, f, 2)
413
- @w_ts.pa(194, 0, 0, out)
430
+ @w_ts.pa(194, 0, 0, out) # MAXx
414
431
  out = magx(d, f, 1/6.4)
415
- @w_ts.pa(189, 0, 0, out)
432
+ @w_ts.pa(189, 0, 0, out) # *FIELD
416
433
  out = magx(d, f, 1/3.6)
417
- @w_ts.pa(189, 0, 0, out)
434
+ @w_ts.pa(189, 0, 0, out) # GX/NEB
418
435
  out = magx(d, f, 1/2.1)
419
- @w_ts.pa(189, 0, 0, out)
436
+ @w_ts.pa(189, 0, 0, out) # PL/GCL
420
437
  out = magx(d, f, 1/1.3)
421
- @w_ts.pa(189, 0, 0, out)
438
+ @w_ts.pa(189, 0, 0, out) # PLd/2*
422
439
  out = magx(d, f, 1/0.7)
423
- @w_ts.pa(189, 0, 0, out)
424
- out = (115.824/d).truncate(2).to_s.rjust(7)
425
- @w_ts.pa(219, 0, 0, out)
426
- out = (3600*Math::asin(671E-6/d)*180/Math::PI).truncate(2).to_s.rjust(8)
427
- @w_ts.pa(219, 0, 0, out)
428
- moon = (384E6*Math::tan((Math::PI/180*115.824/d)/3600))
440
+ @w_ts.pa(189, 0, 0, out) # TGHT2*
441
+ out = (115.824/d).truncate(2).dec2.to_s.rjust(7)
442
+ @w_ts.pa(219, 0, 0, out) # DL-SEP
443
+ out = (3600*Math::asin(671E-6/d).rad).truncate(2).dec2.to_s.rjust(8)
444
+ @w_ts.pa(219, 0, 0, out) # RC-SEP
445
+ moon = (384E6*Math::tan((115.824.deg/d)/3600))
429
446
  out = moon.to_i.to_s.rjust(6) + "m"
430
- @w_ts.pa(225, 0, 0, out)
447
+ @w_ts.pa(225, 0, 0, out) # MOON
431
448
  out = (moon/2.5668).to_i.to_s.rjust(5) + "km"
432
- @w_ts.pa(225, 0, 0, out)
449
+ @w_ts.pa(225, 0, 0, out) # SUN
433
450
  @w_ts.p("\n")
434
451
  end
435
452
  @w_ts.clr_from_cur_line
@@ -460,7 +477,7 @@ def w_ep_show
460
477
  @w_ep.fg = 15
461
478
  @w_ep.bg = 0
462
479
  @ep.each_with_index do |ep, i|
463
- name = ep[0]
480
+ name = ep[0][0...15]
464
481
  m = ep[1].truncate(1)
465
482
  a = ep[2]
466
483
  out = " " + name.ljust(15)
@@ -498,7 +515,7 @@ end
498
515
  # COMMAND FUNCTIONS (bottom window, w_cm)
499
516
  def w_cm_show
500
517
  @w_cm.fill
501
- @w_cm.p(" Telescope v0.2 - By Geir Isene (https://isene.com)")
518
+ @w_cm.p(" Telescope v0.2 - By Geir Isene (https://isene.com) - press '?' to display the help text")
502
519
  end
503
520
  def w_cm_getstr(pretext, text) # A SIMPLE READLINE-LIKE ROUTINE
504
521
  Curses.curs_set(1)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telescope-term
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-09 00:00:00.000000000 Z
11
+ date: 2021-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -32,8 +32,8 @@ dependencies:
32
32
  version: 1.3.2
33
33
  description: 'With this program you can list your telescopes and eyepieces and get
34
34
  a set of calculations done for each scope and for the combination of scope and eyepiece.
35
- Easy interface. Run the program, then hit ''?'' to show the help file. New in v0.4:
36
- Added observation log capabilities.'
35
+ Easy interface. Run the program, then hit ''?'' to show the help file. New in v0.5.3:
36
+ Improved navigation.'
37
37
  email: g@isene.com
38
38
  executables:
39
39
  - telescope