suntrack 0.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.
- data/lib/suntrack.rb +31 -0
- metadata +54 -0
data/lib/suntrack.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Main methods for Ruby version of calculations in "Astronomy on the Personal
|
2
|
+
# Computer", by Montenbruck and Pfleger (1991).
|
3
|
+
|
4
|
+
class Suntrack
|
5
|
+
|
6
|
+
# Return Sun location, in altitude(y) and azimuth(z), given
|
7
|
+
# DateTime, latitude and longitude
|
8
|
+
def self.sun_location(date_time,latitude,longitude)
|
9
|
+
|
10
|
+
mjd = Suntrack::RAstro.to_mjd(date_time)
|
11
|
+
jd = Suntrack::RAstro.jd(mjd)
|
12
|
+
tm = Suntrack::RAstro.get_time(jd)
|
13
|
+
dec = Suntrack::RAstro.sun_position(tm)
|
14
|
+
tau = 15 * (Suntrack::RAstro.lmst(mjd,longitude) - dec.z)
|
15
|
+
z_in = Suntrack::Point3D.new(dec.y,tau,latitude)
|
16
|
+
z = z_in.equatorial_to_horizon
|
17
|
+
z
|
18
|
+
end
|
19
|
+
|
20
|
+
# Return Sirius location, in altitude(y) and azimuth(z), given
|
21
|
+
# DateTime, latitude and longitude
|
22
|
+
def self.sirius_location(date_time,latitude,longitude)
|
23
|
+
mjd = Suntrack::RAstro.to_mjd(date_time)
|
24
|
+
tau = 15 * (Suntrack::RAstro.lmst(mjd,longitude) - Suntrack::RAstro::SIRIUS_RA)
|
25
|
+
z_in = Suntrack::Point3D.new(Suntrack::RAstro::SIRIUS_DECLINATION,tau,latitude)
|
26
|
+
z = z_in.equatorial_to_horizon
|
27
|
+
z
|
28
|
+
end
|
29
|
+
end
|
30
|
+
require 'suntrack/Point3D'
|
31
|
+
require 'suntrack/RAstro'
|
metadata
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: suntrack
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Joel M. Gottlieb
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2012-09-07 00:00:00 Z
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Sun position as function of time
|
17
|
+
email: joel.gottlieb@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- lib/suntrack.rb
|
26
|
+
homepage:
|
27
|
+
licenses: []
|
28
|
+
|
29
|
+
post_install_message:
|
30
|
+
rdoc_options: []
|
31
|
+
|
32
|
+
require_paths:
|
33
|
+
- lib
|
34
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: "0"
|
40
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: "0"
|
46
|
+
requirements: []
|
47
|
+
|
48
|
+
rubyforge_project:
|
49
|
+
rubygems_version: 1.8.21
|
50
|
+
signing_key:
|
51
|
+
specification_version: 3
|
52
|
+
summary: Suntrack
|
53
|
+
test_files: []
|
54
|
+
|