Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks:
Is there a perl module out there that, when, I input the latitude & longitude of a particular location; the module returns the dates when winter, spring, summer and fall begin?
I looked through CPAN and couldn't find anything by module name that jumped right out at me. However, surely , I am thinking that someone must have created this as an internal to some Date-Time module.
So... I call upon your insight and direction..
Which, as always is greatly appreciated!
Thanks in advance for your help.
  • Comment on Is there a module for determining dates of Astronomical Seasons?

Replies are listed 'Best First'.
Re: Is there a module for determining dates of Astronomical Seasons?
by McDarren (Abbot) on Dec 01, 2005 at 15:12 UTC
    erm, unless I'm missing something - you hardly need a module for this. All you need to do is look at the latitude value. If it's negative (Southern Hemisphere), then the seasons fall on one set of dates. And if it's positive (Northern Hemisphere), then they are reversed. Of course, this doesn't account for the polar, tropical and various other regions which don't really have four seasons - but your question didn't mention that.

    cheers,
    Darren :)

Re: Is there a module for determining dates of Astronomical Seasons?
by idsfa (Vicar) on Dec 01, 2005 at 19:36 UTC

    No, all of the above are dead wrong*. Even in the Gregorian calendar, the dates vary.

    The Astronomical definitions of the solstices and equinoxes are when the sun's path through the sky reaches its most extreme (northward or southward) and when it crosses over the equator (north- or south-going). Your physical location on the planet is irrelevant to the discussion. You would only care about latitude for the purposes of differentiating spring & summer from fall & winter.

    • Ascending Equinox - Sun passes over equator, headed north
    • Northern Solstice - Sun at northernmost point in sky
    • Decending Equinox - Sun passes over equator, headed south
    • Southern Solstice - Sun at southernmost point in sky

    See Solstice and Equinox for more links and information.

    If you need to know exactly when the season changes, you want to use DateTime::Event::SolarTerm:

    use DateTime::Event::SolarTerm qw(WINTER_SOLSTICE); my $dt0 = DateTime->new(...); my $winter_solstice = DateTime::Event::SolarTerm->next_term_at( datetime => $dt0, longitude => WINTER_SOLSTICE );

    Note that the equinoxes are not defined as constants, but their solar longitudes are 0 and 180. Which is which is left as an exercise for the student.

    * Yay! I finally get some use out of eleven years of (Astro)physics grad school!


    The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon
Re: Is there a module for determining dates of Astronomical Seasons?
by PerlBear (Hermit) on Dec 01, 2005 at 17:21 UTC
    McDarren is right. You certainly don't need a module for this. Taking the response one step further FYI and others here are the dates for the Northern Hemsiphere (positive latitudes):

    Spring, March 21 (Vernal Equinox)
    Summer, June 22 (Summer Solstice)
    Autumn, September 22 (Autumnal Equinox)
    Winter, December 22 (Winter Solstice)

    Note: Not neglecting our friends in the Southern Hemsiphere, I will post the dates for the Southern Hemsphere soon :) .


    Update: Actually, quite simply, for our Southern Hemsiphere friends things are simply reversed.

    ack! I hate typos! (especially big ones) thank you for pointing out my mistake!
    I do indeed know better. :)
    Spring, September 22 (Vernal Equinox)
    Summer, Decmeber 22 (Summer Solstice)
    Autumn, March 21 (Autumnal Equinox)
    Winter, June 22 (Winter Solstice)

    the correction:
    Autumn, March 21 (Vernal Equinox)
    Winter, June 22 (Winter Solstice)
    Spring, September 22 (Autumnal Equinox)
    Summer, December 22 (Summer Solstice)

    Perl + Science + a bit of typo awareness (think before you type) = Loads of Fun
      I've only had an Intro. to Astronomy course about 20 years ago, but I'm pretty sure the the way you've listed the equinox dates for the southern hemishere isn't quite right.

      Google knows all:

      Vernal Equinox: The sun is on the equator moving north, and marks the beginning of spring, (in the southern hemisphere this is the beginning of autumn).

      I'd list it like this:

      Northern Hemisphere:
      Spring, March 21 (Vernal Equinox)
      Summer, June 22 (Summer Solstice)
      Autumn, September 22 (Autumnal Equinox)
      Winter, December 22 (Winter Solstice)

      Southern Hemisphere:
      Autumn, March 21 (Vernal Equinox)
      Winter, June 22 (Winter Solstice)
      Spring, September 22 (Autumnal Equinox)
      Summer, December 22 (Summer Solstice)

      Cheers,

      Brent

      -- Yeah, I'm a Delt.