solar-0.1.0.0: Simple library for solar calculations

Safe HaskellSafe
LanguageHaskell2010

Data.Time.Solar

Contents

Description

This module contains basic solar calculation functions. It is based on the methods found at https://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html

Accordingly, the same caveats apply. This method is therefore only accurate for dates between 1901 and 2099. The sunrise and sunset results are theoretically accurate to within a minute for locations between +/- 72° latitude, and within 10 minutes outside of those latitudes.

Synopsis

Documentation

data Location Source #

Constructors

Location 

solarNoon :: ZonedTime -> Location -> ZonedTime Source #

Return the time of solar noon in a given timezone for a given day, at a given location. Solar noon is the moment when the sun contacts the observer's meridian, reaching its highest position above the horizon on that day.

solarMidnight :: ZonedTime -> Location -> ZonedTime Source #

Return the time of solar midnight, opposite of solarNoon. Note that this will return the next solar midnight!

sunrise :: ZonedTime -> Location -> ZonedTime Source #

Determine the time of sunrise relative to a zoned time, at a given location.

sunset :: ZonedTime -> Location -> ZonedTime Source #

Determine the time of sunset relative to a zoned time, at a given location.

sunlightDuration :: ZonedTime -> Location -> DiffTime Source #

Duration of sunlight on a given date and location.

hourAngle :: ZonedTime -> Location -> Double Source #

Return hour angle, one of the coordinates used in the equatorial coordinate system to give the direction of a point on the celestial sphere. Given in degrees.

trueSolarTime :: ZonedTime -> Location -> DiffTime Source #

Time of day at a given location as measured by the movement of the sun, given as time after midnight.

solarZenithAngle :: ZonedTime -> Location -> Double Source #

The solar zenith angle is the angle between the zenith and the centre of the Sun's disc. Given in degrees.

solarElevationAngle :: ZonedTime -> Location -> Double Source #

The solar elevation angle is the altitude of the Sun, the angle between the horizon and the centre of the Sun's disc. Given in degrees. Complimentary to solarZenithAngle.

Local Solar Time

solarNoonLST :: ZonedTime -> Location -> Double Source #

Solar Noon given in local solar time.

sunriseLST :: ZonedTime -> Location -> Double Source #

Sunrise given in local solar time.

sunsetLST :: ZonedTime -> Location -> Double Source #

Sunset given in local solar time.

Re-Export

data ZonedTime #

A local time together with a time zone.

Instances
Data ZonedTime 
Instance details

Defined in Data.Time.LocalTime.Internal.ZonedTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ZonedTime -> c ZonedTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ZonedTime #

toConstr :: ZonedTime -> Constr #

dataTypeOf :: ZonedTime -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ZonedTime) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ZonedTime) #

gmapT :: (forall b. Data b => b -> b) -> ZonedTime -> ZonedTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ZonedTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ZonedTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> ZonedTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ZonedTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ZonedTime -> m ZonedTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ZonedTime -> m ZonedTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ZonedTime -> m ZonedTime #

Show ZonedTime 
Instance details

Defined in Data.Time.LocalTime.Internal.ZonedTime

NFData ZonedTime 
Instance details

Defined in Data.Time.LocalTime.Internal.ZonedTime

Methods

rnf :: ZonedTime -> () #

FormatTime ZonedTime 
Instance details

Defined in Data.Time.Format

ParseTime ZonedTime 
Instance details

Defined in Data.Time.Format.Parse