# `Astro.Saros`
[🔗](https://github.com/kipcole9/astro/blob/v2.11.0/lib/astro/saros.ex#L1)

The Saros series of an eclipse, numbered as NASA's eclipse catalogues
number them.

Eclipses recur after a *saros* of 223 lunations, 18 years 11 days and
about 8 hours: the Sun, the Moon and the Moon's node return to nearly
the same arrangement, so an eclipse is followed by a similar one 223
lunations later. The eclipses a saros apart form a *Saros series*,
which begins with small partial eclipses near one pole, runs through
central eclipses that move across the Earth and ends with partial
eclipses near the other pole: 69 to 87 eclipses over 1,226 to 1,550
years.

An *inex* of 358 lunations, about 29 years, links neighbouring
series: the eclipse an inex after an eclipse of series `s` belongs to
series `s + 1`. So every eclipse of series `s` falls at a lunation `n`
(`Astro.Lunar.lunation_at/1`) with `n ≡ 358 s + c (mod 223)` for a
constant `c`, one for solar eclipses and another for lunar, and the
series follows from the lunation to within a multiple of 223:
`s ≡ 38 (n − c) (mod 223)`, 38 being the inverse of 358 modulo 223.

The series in progress at a time form a band about 50 numbers wide,
which moves on by about one number every 30 years, so the multiple of
223 is the one that puts the series nearest a straight-line estimate
of the band from the lunation. The numbering is G. van den Bergh's,
from his Saros–Inex panorama, as NASA's catalogues use it. The
constants and the band are fitted to the catalogues and reproduce
the series of every eclipse in six of their centuries between −999
and 3000; far beyond them the numbering continues by the same rule.

### Reference

* G. van den Bergh, *Periodicity and Variation of Solar (and Lunar)
  Eclipses* (1955).

* Fred Espenak, [Eclipses and the Saros](https://eclipse.gsfc.nasa.gov/SEsaros/SEsaros.html),
  NASA Goddard Space Flight Center.

# `series`

```elixir
@spec series(integer(), :solar | :lunar) :: integer()
```

Returns the Saros series of the eclipse of a lunation.

### Arguments

* `lunation` is the lunation of the eclipse, as
  `Astro.Lunar.lunation_at/1` numbers it: for a solar eclipse the
  lunation that begins with its new moon, and for a lunar eclipse the
  lunation in which its full moon falls.

* `kind` is `:solar` or `:lunar`.

### Returns

* The Saros series number, an integer.

### Examples

The total solar eclipse of 8 April 2024 is in lunation 300 and the
total lunar eclipse of 14 March 2025 in lunation 311:

    iex> Astro.Saros.series(300, :solar)
    139

    iex> Astro.Saros.series(311, :lunar)
    123

---

*Consult [api-reference.md](api-reference.md) for complete listing*
