Boost logo

Boost :

Subject: Re: [boost] Is Boost.Astronomy feasible?
From: Matthias Schabel (boost_at_[hidden])
Date: 2008-11-05 13:27:50


> Some examples on what calculations I think would be common are:
>
> o sunrise, sunset, noon
>
> o sun elevation, azimuth, declination
>
> o length of the day
>
> o phase of the moon, and whether the visible fraction is
> increasing or not

Many of these types of calculations fall under the general domain of
"astrometry" rather
than astronomy. I think this would be a very interesting addition to
Boost, though, like
any non-trivial problem domain, it will be a challenge to find the
appropriate balance
between feature-richness and excessive mission creep... Some of the
functionality listed
here might be most sensible as an inclusion to Boost Date/Time...

> o The sun may set/rise more than once during a day in polar regions,
> or it may do neither.

Methods for getting all sunrises/sunsets within a given time window
would make sense to me.

> o What is the definition for the length of the day if sunrise/sunset
> occurs more than once during a day?

Again, a method for getting the interval between sunset and sunrise
within a given time window
would sidestep this issue.

> o Are separate methods needed for testing whether the given date
> is of type "polar day" or "polar night" or "midnight sun"?
> The definitions for the three seem to be a bit ambiguous. For
> example, it is perfectly possible for the sun to be up at midnight
> but still to set during the day, in which case you would have
> "midnight sun" but not necessarily a "polar day", when the sun
> shines 24h.

I would expect methods to query whether the sun is up or down at a
given time/geographic location.
Special functionality for polar regions could be built on top of that...

> Many places refer to Meeus's work for the most accurate
> calculations. The formulas have been ported to C++ in the form
> of the AA++ (astronomical algorithms) library. However, the
> library seems to be aimed for experts and there are no easy
> recipies for solving the common problems mentioned above.

Meeus' book is a good one. Another good source for astrometry code/
information is the Naval
Observatory Vector Astrometry Subroutines (NOVAS) library - this is
more focused on astrometry,
but would be helpful if you wanted the library to support moonrise/
moonset or rise/set times for
planets.

> o Would a boost::astronomy namespace as implied above be
> a good addition to boost?

I would vote for boost::astrometry.

> o Are there any experts out there who understand the subject
> matter well enough to provide a robust implementation or
> atleast guidance on the matter?

I have a fair amount of experience with astrometry software, but not
tons of free time. I would be
happy to discuss interface issues and, where possible, to point you to
existing implementations
that might be useful. Be forewarned : this is likely to become a much
bigger undertaking than it
seems. To do all this correctly would require support for vector
geometry, GIS, multiple time systems,
etc... I would recommend trying to add some of the basic sunrise/set
functionality to Date-Time
first and see how that goes...

Matthias

>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk