https://github.com/gregology/gstatsat
A Ruby Gem for calculating bearings of geostationary satellites
https://github.com/gregology/gstatsat
gem ruby
Last synced: 2 months ago
JSON representation
A Ruby Gem for calculating bearings of geostationary satellites
- Host: GitHub
- URL: https://github.com/gregology/gstatsat
- Owner: gregology
- License: mit
- Created: 2017-03-11T17:52:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-13T02:45:40.000Z (over 9 years ago)
- Last Synced: 2025-10-31T10:47:11.548Z (8 months ago)
- Topics: gem, ruby
- Language: Ruby
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://rubygems.org/gems/gstatsat)
[](https://github.com/gregology/gstatsat/blob/master/LICENSE)
[](http://gregology.net/contact/)
[](http://rubygems.org/gems/gstatsat)
# Gstatsat
A Ruby Gem for calculating bearings of geostationary satellites
## Installation
Add this line to your application's Gemfile:
``` ruby
gem 'gstatsat'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install gstatsat
## Example
``` ruby
>> require 'gstatsat'
=> True
>> base_station = Gstatsat::BaseStation.new(latitude: 45.425533, longitude: -75.692482)
>> satellite = Gstatsat::Satellite.new(longitude: -98)
>> bearing = Gstatsat::SatelliteBearing.new(satellite: satellite, base_station: base_station)
>> bearing.azimuth
=> 209.9
>> bearing.elevation
=> 33.2
>> bearing.visible?
=> True
```
## Notes
The `visible?` method on `SatelliteBearing` is based on an elevation greater than 0. This simplified model assumes the earth is a perfect sphere and that the base station is at sea level. A satellites actual visibility may be affected by natural features such as mountains. It may also be possible to sight a satellite at a bearing less than 0 if the base station is at orbital altitudes.