astronoby gem v0.1.0 released
Tags: ruby, astronomy, computing
Published: 2024-02-28 10:30:40

**I am proud to announce the first official non-major version of [`astronoby`].**

[`astronoby`]: https://rubygems.org/gems/astronoby

## What is Astronoby?

Astronoby is a Ruby gem I created almost two years ago. It is a project meant to enable Ruby developers to compute astronomical data and events.

## Why?

Astronomy is universal. Astronomical knowledge doesn't belong to anyone. But it is also hard to grasp, calculate and comprehend.

Almost 10 years ago, I tried to make web apps with astronomical data by scrapping websites. It felt wrong. Why should we rely on proprietary content, often protected with techniques against scrapping, to access such universal data?

I then decided to go deeper and compute the data myself, with existing Python libraries such as [PyEphem] and [Skyfield]. I have nothing against Python, and to be honest the Python ecosystem is incredibly more advanced on this kind of scientific topic than Ruby will probably ever be. But I wasn't satisfied not to be able to the the programming languages _I wanted to_.

[PyEphem]: https://rhodesmill.org/pyephem/

[Skyfield]: https://rhodesmill.org/skyfield/

This couldn't be the end of it. Is astronomical computing in Ruby really something impossible? When getting started with astronomy, astrometry and programming, do we always have to use tools so powerful and complicated that even professional astronomers use them?

I created Astronoby for these reasons:
- Make the formulas and calculations accessible to developers of any level
- Bring a new tool to the list of scientific projects to the Ruby community
- Have fun and understand how these giant things up there move

## What now?

This first official version is only the first step. For the first time, this gem enables developers to compute one data: the Sun's location in the sky based on an observer's location and a time. This only _real_ feature is the reason this first release is not a major one.

```rb
time = Time.utc(2023, 2, 17, 11, 0, 0)
epoch = Astronoby::Epoch.from_time(time)

latitude = Astronoby::Angle.as_degrees(48.8566)
longitude = Astronoby::Angle.as_degrees(2.3522)

sun = Astronoby::Sun.new(epoch: epoch)

horizontal_coordinates = sun.horizontal_coordinates(
  latitude: latitude,
  longitude: longitude
)

horizontal_coordinates.altitude.str(:dms)
```

It is not ground breaking, but it is a first step. Later will come more features associated with the Sun, like sunrise and sunset, equinoxes and solstices. Then, some data related with the Moon will come up like phases and eclipses. After that, the planets will be introduced with multiple events to predict.

The list is long and the remaining work is tremendous. This will take time, especially as one of the main goal is not only to make it work -libraries in other languages already do this- but to make it understandable, maintainable and pleasant to use for anyone enjoying astronomy or Ruby, or both.

It already took me two years of inconsistent spikes to reach this first step. But I believe the new ones will be easier to get to now that some foundations are built.

## Contributing

I am aware this kind of project is not easy to contribute to, as most of the new features will be a Ruby translation from books I read by authors like Jean Meeus, J. L. Lawrence, Peter Duffet-Smith and Jonathan Zwart.

The Ruby code though, all the good practices, performance improvements, bux fixes, documentation, are accessible to anyone. This is my first gem, I already made many mistakes I tried to slowly fix and I am aware the gem could already benefit from many improvements unrelated to adding features.

I am also interested in learning more from the community what this library could be. It doesn't have to stop to features covered by a few books. A lot of things can happen, and this is the reason I am releasing this first official version: to make the project finally open to the community.

Please spread the word, share your thoughts, join the project and let's enjoy our excitement for astronomy and Ruby.

Cheers.

- [`astronoby` on RubyGems](https://rubygems.org/gems/astronoby)
- [`astronoby` on GitHub](https://github.com/rhannequin/astronoby)

---

<small>Cover picture credits: [_Between Solstices by György Soponyai_](https://www.rmg.co.uk/stories/topics/summer-winter-solstices-explained-how-sun-determines-longest-shortest-days-year)</small>