telescope-term 0.5 → 0.5.4

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 +69 -47
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b0de1183d0d4197c99af85b31b0219c172ae66f0deb6b26a84e68f25e3a69af
4
- data.tar.gz: c58af4a71983444111c6583fc6b7de99afe6518adb45b94ff8dd46f7dfc3e3be
3
+ metadata.gz: 1e39aeebfaa4fecec0d561cbdc2af5185dc6a0d7290de68a38cc5192c2e90867
4
+ data.tar.gz: aac05e0a5b7e9f8f134dbb1cd8b3e7c4d69bddecbeeec241c032e7aa53d222a1
5
5
  SHA512:
6
- metadata.gz: 2f50f189e964d58bed2ff5e6a21c53f89ffe0ac9b9f2828869df9cab94fb006b1fc5cf03f582c1faf91b8c492a37ea3985204e01ebe3c7e100e4662d953de85e
7
- data.tar.gz: 2292e4a4e17027e01a5988945b6d8937a5c358340fee014167e60debb6b12662ac18d5bddc31edbc0af9db831aa117613f48ab2fb1d20920c6833796cb9dd606
6
+ metadata.gz: fece1d6680316403ff013e5328da25fba67a101648914a65b3d0ae4a3c9275130cab17c476d307850345a8ec09e16888353f9107e0eaa65faf0746a29e190ed2
7
+ data.tar.gz: 3182803706369be8ab32e191bac1219795983942766f4ce4bcf2a54fc57c793b15c65ec49481620eb13570a750c872fddd34e2ce5981f78b356e7fb345b9b511
data/bin/telescope CHANGED
@@ -4,30 +4,24 @@
4
4
  WELCOME TO TELESCOPE - A TERMINAL/CONSOLE PROGRAM FOR THE AMATEUR ASTRONOMER.
5
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
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 pressing TAB, then UP/DOWN cursor keys.
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
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
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
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
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
12
  Telescope and eyepiece data is saved in the file '.telescope' in your home directory (backup file is '.telescope.bu').
13
13
 
14
- LIST OF TELESCOPE ABBREVIATIONS: LIST OF EYEPIECE ABBREVIATIONS:
15
- APP = Apperature (in millimeters) FL = Focal Length (in millimeters)
16
- FL = Focal Length (in millimeters) AFOV = Apparent Field Of View
17
- F/? = Focal ratio (FL/APP) xMAGN = Magnification (with that telescope)
18
- <MAG = Maximum magnitude visible FOV = True Field Of View (deg/min/sec)
19
- xEYE = Light gathering compared to the human eye XPUP = Exit pupil (in millimeters)
20
- MINx = Minimum usable magnification (may be lower for refractors)
21
- MAXx = Maximum usable magnification
22
- *FIELD = Recommended magnification for star fields
23
- GX/NEB = Recommended magnification for galaxies and nebulae
24
- PL/GCL = Recommended magnification for planets and globular clusters
25
- PLd/2* = Recommended magnification for planet details and double stars
26
- TGHT2* = Recommended magnification for tight double stars
27
- DL-SEP = Minimum separation, Dawes limit
28
- RC-SEP = Minimum separation, Rayleigh limit
29
- MOON = Minimum feature resolved on the Moon (in meters)
30
- 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)
31
25
  HELPTEXT
32
26
  begin # BASIC SETUP
33
27
  if `tput cols`.to_i < 140
@@ -60,6 +54,12 @@ end
60
54
  class Numeric # NUMERIC CLASS EXTENSION
61
55
  def deg
62
56
  self * Math::PI / 180
57
+ end
58
+ def rad
59
+ self * 180 / Math::PI
60
+ end
61
+ def dec2
62
+ "%.2f" % self
63
63
  end
64
64
  end
65
65
  class Curses::Window # CLASS EXTENSION
@@ -249,15 +249,37 @@ def main_getkey # GET KEY FROM USER
249
249
  end
250
250
  when 'UP' # Examples of moving up and down in a window
251
251
  if @tsmark
252
- @tsmark -= 1 unless @tsmark == 0
252
+ if @tsmark == 0
253
+ @tsmark = false
254
+ else
255
+ @tsmark -= 1
256
+ end
253
257
  elsif @epmark
254
- @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
255
266
  end
256
267
  when 'DOWN'
257
268
  if @tsmark
258
- @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
259
275
  elsif @epmark
260
- @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
261
283
  end
262
284
  when 'PgUP'
263
285
  if @tsmark
@@ -339,7 +361,7 @@ def observe
339
361
  mag = (5 * Math::log(d/10, 10) + 7.5).truncate(1).to_s
340
362
  obs += " Max MAG: " + mag
341
363
  sepd = (115.824/d).truncate(2).to_s
342
- 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
343
365
  obs += " Min SEP: " + sepd + "/" + sepr + "\n"
344
366
  end
345
367
  obs += "No telescope(s) chosen for the observation\n" if @tstag.empty?
@@ -380,51 +402,51 @@ end
380
402
  # TELESCOPE FUNCTIONS (top window, w_ts)
381
403
  def w_ts_show
382
404
  @w_ts.setpos(0,0)
383
- heading = " TELESCOPES APP(mm) FL(mm) F/? <MAG xEYE MINx MAXx *FIELD GX/NEB PL/GCL PLd/2* TGHT2* DL-SEP RC-SEP MOON SUN"
405
+ heading = " TELESCOPES APP(mm) FL(mm) F/? <MAG xEYE MINx MAXx *FIELD GX/NEB PL/GCL PLd/2* TGHT2* DL-SEP RC-SEP MOON SUN"
384
406
  heading += " " * (@w_ts.maxx - heading.length).abs
385
407
  @w_ts.pa(255, 94, Curses::A_BOLD, heading)
386
408
  @w_ts.fg = 15
387
409
  @w_ts.bg = 0
388
410
  @ts.each_with_index do |scope, i|
389
- name = scope[0]
411
+ name = scope[0][0...18]
390
412
  d = scope[1]
391
413
  f = scope[2]
392
- out = " " + name.ljust(15)
414
+ out = " " + name.ljust(18)
393
415
  out += d.to_s.rjust(8)
394
416
  out += f.to_s.rjust(8)
395
417
  attr = Curses::A_BOLD
396
418
  attr = attr | Curses::A_REVERSE if @tsmark == i
397
419
  attr = attr | Curses::A_UNDERLINE if @tstag.include?(i)
398
- @w_ts.pa(254, 0, attr, out)
420
+ @w_ts.pa(254, 0, attr, out) # Basic info (Name, APP, FL)
399
421
  out = (f.to_f/d.to_f).truncate(1).to_s.rjust(6)
400
- @w_ts.pa(254, 0, 0, out)
422
+ @w_ts.pa(254, 0, 0, out) # F/?
401
423
  out = (5 * Math::log(d/10, 10) + 7.5).truncate(1).to_s.rjust(6)
402
- @w_ts.pa(229, 0, 0, out)
424
+ @w_ts.pa(229, 0, 0, out) # <MAG
403
425
  out = (d**2/49).to_i.to_s.rjust(6)
404
- @w_ts.pa(229, 0, 0, out)
426
+ @w_ts.pa(229, 0, 0, out) # xEYE
405
427
  out = magx(d, f, 1/7.to_f)
406
- @w_ts.pa(194, 0, 0, out)
428
+ @w_ts.pa(194, 0, 0, out) # MINx
407
429
  out = magx(d, f, 2)
408
- @w_ts.pa(194, 0, 0, out)
430
+ @w_ts.pa(194, 0, 0, out) # MAXx
409
431
  out = magx(d, f, 1/6.4)
410
- @w_ts.pa(189, 0, 0, out)
432
+ @w_ts.pa(189, 0, 0, out) # *FIELD
411
433
  out = magx(d, f, 1/3.6)
412
- @w_ts.pa(189, 0, 0, out)
434
+ @w_ts.pa(189, 0, 0, out) # GX/NEB
413
435
  out = magx(d, f, 1/2.1)
414
- @w_ts.pa(189, 0, 0, out)
436
+ @w_ts.pa(189, 0, 0, out) # PL/GCL
415
437
  out = magx(d, f, 1/1.3)
416
- @w_ts.pa(189, 0, 0, out)
438
+ @w_ts.pa(189, 0, 0, out) # PLd/2*
417
439
  out = magx(d, f, 1/0.7)
418
- @w_ts.pa(189, 0, 0, out)
419
- out = (115.824/d).truncate(2).to_s.rjust(7)
420
- @w_ts.pa(219, 0, 0, out)
421
- out = (3600*Math::asin(671E-6/d)*180/Math::PI).truncate(2).to_s.rjust(8)
422
- @w_ts.pa(219, 0, 0, out)
423
- 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))
424
446
  out = moon.to_i.to_s.rjust(6) + "m"
425
- @w_ts.pa(225, 0, 0, out)
447
+ @w_ts.pa(225, 0, 0, out) # MOON
426
448
  out = (moon/2.5668).to_i.to_s.rjust(5) + "km"
427
- @w_ts.pa(225, 0, 0, out)
449
+ @w_ts.pa(225, 0, 0, out) # SUN
428
450
  @w_ts.p("\n")
429
451
  end
430
452
  @w_ts.clr_from_cur_line
@@ -448,17 +470,17 @@ def w_ep_show
448
470
  end
449
471
  heading = " " * (@w_ep.maxx - @w_ep.curx)
450
472
  @w_ep.p(heading)
451
- heading = " EYEPIECES FL(mm) AFOV "
473
+ heading = " EYEPIECES FL(mm) AFOV "
452
474
  heading += "│ xMAGN FOV(dms) XPUP " * @ts.length
453
475
  heading += " " * (@w_ep.maxx - heading.length).abs
454
476
  @w_ep.pa(231, 240, Curses::A_BOLD, heading)
455
477
  @w_ep.fg = 15
456
478
  @w_ep.bg = 0
457
479
  @ep.each_with_index do |ep, i|
458
- name = ep[0]
480
+ name = ep[0][0...18]
459
481
  m = ep[1].truncate(1)
460
482
  a = ep[2]
461
- out = " " + name.ljust(15)
483
+ out = " " + name.ljust(18)
462
484
  out += m.to_s.rjust(8)
463
485
  out += a.to_s.rjust(6) + "°"
464
486
  attr = Curses::A_BOLD
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.5'
4
+ version: 0.5.4
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-12 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.5:
36
- Improved help text.'
35
+ Easy interface. Run the program, then hit ''?'' to show the help file. New in v0.5.4:
36
+ Wider name for telescopes/eyepieces.'
37
37
  email: g@isene.com
38
38
  executables:
39
39
  - telescope