Skip to content

mml/sonox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

This script relies on nothing but core Perl modules and is able to
tell you about solstices and equinoxes in local time from 2000 through
2025.  It assumes you are in the Northern hemisphere.

    Usage: sonox [OPTIONS]

    If no OPTIONS, defaults to --since.

      -h, --help        This text.
      -N, --northern    Assume Northern hemisphere rather than Southern. (default)
      -S, --southern    Assume Southern hemisphere rather than Northern.
      -s, --since       Show number of days since last solstice or equinox.
      -u, --until       Show number of days until next solstice or equinox.
      -l, --last[=N]*   Show last N solstices and equinoxes.
      -n, --next[=N]*   Show next N solstices and equinoxes.
      -y, --year[=Y]**  Show all 4 solstices and equinoxes for the year Y.

    * N defaults to 1.

    ** Y defaults to the current year.

    Northern hemisphere is the default unless the SONOX_SOUTHERN environment
    variable is set to 1.

I've written several scripts to combine astronomical calculations with
calendrical and come up with local times for the equinoxes, solstices,
cross-quarter days, etc.  But they end up being very non-portable
because of huge library dependencies.

I wanted a script I could run anywhere that could at least tell me
some basic info about the current time and its relation to the
seasons.  It finally dawned on me that if I didn't try to do astro
calculations, it would be pretty easy in Perl with core modules.

TODO
- Expand the data set.
- A little testing wouldn't hurt.
- Option to install w/ symlink would make updating easier.
- Support setting both -l and -n... -u and -s already work together, but why not
  both -l and -n?
- Detect not just when @$after is empty, but also when the last element of
  @$before is > 100 days old (strong signal the results are bogus)
- Bounds checking in the rest of the code.
- A little less Perl cleverness.

About

Solstice/Equinox CLI tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published